Class AsynchronousFTP
Object
|
+--AsynchronousFTP
- class
AsynchronousFTP
Sample that shows hows to upload files asynchronously from Adobe Bridge to an FTP server; to run this, you must modify the code and supply FTP settings to access your own FTP server.
Usage
You must edit the FTP settings within this code; the code as shipped does not provide any default
values for these settings and if you do not edit the FTP settings in the code (see "FTP server configuration" below),
then the code will not run correctly. For the sample to execute correctly, you need access to an FTP server.
- Ensure the FTP settings match your FTP server configuration
- Ensure local and remote files and paths are correct
- Make sure Adobe Bridge is running
- In ExtendScript Toolkit set Target > Adobe Bridge CS5
- Run this snippet. At this point, a context-sensitive menu item and handlers have been created, and
if you select one or more files, you can see a new menu item added by this sample.
- Ensure the file to upload is large enough to take some time before the upload is complete
- In Bridge, select the thumbnail for the file to upload, Right click > "SDK Asynch FTP: Upload". You can select multiple files if you wish
but folders are ignored.
Description
This sample shows how to create an asynchronous FTP connection. A file is uploaded
to the FTP server, whilst still leaving control with the scripting environment of Bridge; this means that
Bridge is still responsive to the end-user when the file is being uploaded to the FTP server. A callback
function is used to determine when the upload operation is complete.
See:
Defined in AsynchronousFTP.jsx
Field Summary |
String |
ftpAddress
The FTP server address to which you want to upload,
which you must change to an FTP server to which you have access - this must be populated for the sample
to function correctly. |
String |
ftpDir
The directory where uploaded files will be stored. |
String |
ftpPassword
The ftp password - this must be populated for the sample
to function correctly. |
String |
ftpUsername
The ftp username used to connect to the FTP server - this must be populated for the sample
to function correctly. |
String |
requiredContext
The context in which this snippet can run. |
Method Summary |
Boolean
|
canRun()
Determines whether snippet can be run given current context.
|
Boolean
|
run()
Functional part of this snippet.
|
ftpAddress
String ftpAddress
The FTP server address to which you want to upload,
which you must change to an FTP server to which you have access - this must be populated for the sample
to function correctly.
ftpDir
String ftpDir
The directory where uploaded files will be stored.
ftpPassword
String ftpPassword
The ftp password - this must be populated for the sample
to function correctly.
ftpUsername
String ftpUsername
The ftp username used to connect to the FTP server - this must be populated for the sample
to function correctly.
requiredContext
String requiredContext
The context in which this snippet can run.
AsynchronousFTP
AsynchronousFTP()
canRun
Boolean canRun()
Determines whether snippet can be run given current context. The snippet will
fail if these preconditions are not met:
- Bridge must be running
- Config settings must be changed to match your systems
Returns:
True is this snippet can run, false otherwise
run
Boolean run()
Functional part of this snippet. Create the FTP object and upload a large file. The upload
is started asynchronously allowing the script to contiue to run. A message is displayed in the
console showing the upload process is still ongoing but the script is not blocked. A callback
function is used to determine when the upload process is complete.
Returns:
True if the snippet ran as expected, false otherwise. If any of the FTP settings are incorrect or Bridge is not running, returns false.
http://www.adobe.com/devnet/bridge
Documentation generated by
JSDoc on Tue Apr 27 10:21:34 2010