Automatically detecting the transfer mode

Top  Previous  Next

When downloading files the transfer mode is by default set to binary. Using the Ftps#setAuto method you may set it to automatically detect the transfer mode to use ( ASCII or binary) based on the file extension of the file transferred. If you are downloading multiple files it is often convenient to have the transfer mode automatically detected and set based on the type of file being downloaded.

 

Binary files such as images should be downloaded using the binary transfer mode. ASCII files such as text documents should be downloaded using the ASCII transfer mode. You can have this handled automatically using the Ftps#setAuto method.

 

Example

 

// enable auto transfer mode

ftps.setAuto(true);    

 

// download all files ending with .gif extension to current local directory

ftps.mdownload("*.gif");





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC