FTP

Upload photoshop scripts, download photoshop scripts, discussion and support of photoshop scripts

Moderator: PS-Moderators

FTP

Postby xbytor » Fri Aug 03, 2007 5:26 am

I've implemented some code to simplify uploading files to an FTP server. Since the webaccess dll in CS3 only works with Bridge, this script uses Bridge for the actual transfer even though you can call it from PS.

Here is some sample code that I've been using for testing from PS and ESTK:

Code: Select all
//
//@show include
//
//@includepath "/c/Program Files/Adobe/xtools;/Developer/xtools"
//
//@include "xlib/FTP.jsx"
//@nclude "xlib/XBridgeTalk.jsx"
//

RemoteFtpConnection.test = function() {
  var conf = new FTPConfig();

  conf.passive      = false;
  conf.username   = "xbytor";
  conf.password   = "password";
  conf.hostname   = "192.168.1.114";
  conf.logFile    = "~/ftp.log";
  conf.logEnabled = true;

  var ftp = RemoteFtpConnection.createFrom(conf);

  ftp.putDirTree(new Folder("/c/cygwin/home/xbytor/images"),
                 "tmp/images");
  $.writeln("Done.");
};

RemoteFtpConnection.test();


The only api I've implemented on the RemoteFtpConnection class is putDirTree which will upload an entire directory tree to the server in the designated folder. That was the particular problem I had to solve; I'm adding ftp upload to my web photo gallery extension package.

I'll add other APIs as I need them or as people request.

-X
Attachments
FTP.zip
(4.73 KiB) Downloaded 805 times
xbytor
Site Admin
 
Posts: 2286
Joined: Thu May 19, 2005 12:11 pm
Location: In Limbo

Postby xbytor » Thu Apr 01, 2010 2:39 am

That code use Bridge to do the FTP and, as far as I can tell, Bridge still bundles the necessary library (webaccesslib) so it should work.

You should probably get the most current version from sourceforge.net (xtools/xlib/FTP.jsx) and you may need to tweak it to work with CS4 as it is hardwired to work on in CS3 at the moment.

Let me know how it goes.

-X
xbytor
Site Admin
 
Posts: 2286
Joined: Thu May 19, 2005 12:11 pm
Location: In Limbo


Return to Photoshop Scripts

Who is online

Users browsing this forum: No registered users and 1 guest