FTPPutFile Multiple Files (2012)

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

FTPPutFile Multiple Files (2012)

Post by Snickers » Wed Jun 27, 2012 4:18 pm

I am trying to FTPputFile multiple files in a remote folder, with no luck. I can put a single file but not multiple.

I am using the following code and have tried numbers others:

Code: Select all

FTPPutFile>ftp.myserver.com,[email protected],%serverpass%,21,%SCRIPT_DIR%\images\*.jpg, %remotePath%/images/,,A
The above code generates this FTP_RESULT:
550-Can't change directory to /public_html/MYFOLDER/MYFOLDER2/images/: No such file or directory
The directory does exist.


The following code works perfectly:

Code: Select all

FTPPutFile>ftp.myserver.com,[email protected],%serverpass%,21,%SCRIPT_DIR%\permissions.txt,%remotePath%/,%remotePath%/permissions.txt,A

What am I doing wrong with the FTPputfile code?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jun 27, 2012 4:38 pm

I see there's a preceding space in the remote path. Not sure if that is an issue, but try without.

Otherwise, I'd really need to see the FTP server's folder/file structure to be able to advise further.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

space fixed it

Post by Snickers » Wed Jun 27, 2012 5:30 pm

Removing the space fixed it; however, the file is corrupted. The file I am sending is a jpg image but it can't be viewed.

http://www.qualityprintingcheap.com/Dig ... image1.jpg

and when you refresh the page, the image changes...

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Re: space fixed it

Post by Me_again » Wed Jun 27, 2012 10:01 pm

Snickers wrote:Removing the space fixed it; however, the file is corrupted. The file I am sending is a jpg image but it can't be viewed.
.jpg is a binary file, but you are FTP'ing using ASCII mode (the ",,A" option), change to binary mode and it should be OK.

Command Reference: Mode can be either A or I, where A represents ASCII transfer mode and I represents binary

Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Post by Snickers » Thu Jun 28, 2012 4:17 pm

Perfect. Thank you!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts