ftp files corrupted

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

ftp files corrupted

Post by bbrink » Sun Jan 24, 2010 5:48 pm

Hello,

When the following script runs I can later download AcmeInstall_AccountMate.exe it and run it without error.

Code: Select all

CopyFile>K:\Acme\Builds\AcmeInstall_AccountMate_20100113_00564.exe,K:\Acme\Builds\AcmeInstall_AccountMate.exe
CopyFile>K:\Acme\Builds\AcmeInstall_AccountMate_20100113_00564.exe,K:\Acme\Builds\Build_On_Web\AcmeInstall_AccountMate.exe

Let>FTP_STATUS=1
Let>FTP_TIMEOUT=15
FTPPutFile>ftp.acmepos.com,password,1234Qwer,21,k:\Acme\Builds\AcmeInstall_AccountMate.exe,/htdocs,AcmeInstall_AccountMate3.exe,I
Message>FTP_RESULT
When I use the following script the AcmeInstall_AccountMate.exe becomes corrupted somehow. I download and run it I get this on Windows 7:

"The version of this file is not compatible with the version of Windos you're running. Check you computer's system information to see whether you need an x86 (32bit) or x64 (64bit) version of the program then contact the publisher."

If I try to execute on a Windows XP machine I just get a black flash that looks like th ecommand prompt was opened and immediatley closed.

Here is the script:

Code: Select all

//AccountMate
DeleteFile>K:\Acme\Builds\AcmeInstall_AccountMate.exe
GetFileList>K:\Acme\Builds\AcmeInstall_AccountMate_*.exe,FileList,;
Separate>FileList,;,Files

Let>Max=Files_Count
GoSub>Bubble_Sort

//Sorts Files_x array
//Set Max to number of elements
SRT>Bubble_Sort
  Let>has_swapped=0
  let>i=1
  Repeat>i
         Let>next=i+1
         //change sign on next line to change direction of sort
         if>Files_%i%>Files_%next%
         Let>store=Files_%i%
         Let>Files_%i%=Files_%next%
         Let>Files_%next%=%store%
         Let>has_swapped=1
     endif
     Let>i=i+1
  Until>i=Max
  If>has_swapped=1
     GoSub>Bubble_Sort
  Endif
End>Bubble_Sort

Files_%Files_Count%:

Let>theFile=Files_%Files_Count%
CopyFile>theFile,K:\Acme\Builds\AcmeInstall_AccountMate.exe
CopyFile>theFile,K:\Acme\Builds\Build_On_Web\AcmeInstall_AccountMate.exe

Let>FTP_STATUS=1
Let>FTP_TIMEOUT=15
FTPPutFile>ftp.acmepos.com,bbrink2010lb,password,21,k:\Acme\Builds\AcmeInstall_AccountMate.exe,/htdocs,AcmeInstall_AccountMate3.exe,I
Message>FTP_RESULT

In all cases the FTP_RESULT returns SUCCESS

All help greatly appreciated!

Bob

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

Post by Marcus Tettmar » Mon Jan 25, 2010 9:57 am

Odd. What happens if you set FTP_PASSIVE=1 ?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

Post by bbrink » Mon Jan 25, 2010 5:48 pm

Hi Marcus,

I added it right before FTP_STATUS so it looks like this:

Code: Select all

Let>FTP_PASSIVE=1
Let>FTP_STATUS=1
Let>FTP_TIMEOUT=15
FTPPutFile>ftp.acmepos.com,bbrink2010lb,password,21,k:\Acme\Builds\AcmeInstall_AccountMate.exe,/htdocs,AcmeInstall_AccountMate7.exe,I
Message>FTP_RESULT
the FTP_RESULT still comes back with SUCCESS but when I DL the EXE it is still corrupt.

bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

Post by bbrink » Mon Jan 25, 2010 7:54 pm

Hello,

I also tried adding a wait to the file copy command that immediately precede the FTP, thinking that perhaps the OS was not done copying the files when the FTP starts. this made no difference.

Code: Select all

Let>theFile=Files_%Files_Count%
CopyFile>theFile,K:\Acme\Builds\AcmeInstall_AccountMate.exe
wait>180
CopyFile>theFile,K:\Acme\Builds\Build_On_Web\AcmeInstall_AccountMate.exe
wait>180

Let>FTP_PASSIVE=1
Let>FTP_STATUS=1
Let>FTP_TIMEOUT=15
FTPPutFile>ftp.acmepos.com,bbrink2010lb,1234Qwer,21,k:\Acme\Builds\AcmeInstall_AccountMate.exe,/htdocs,AcmeInstall_AccountMate8.exe,I
Message>FTP_RESULT

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

Post by Marcus Tettmar » Tue Jan 26, 2010 9:31 am

Hi,

Are you able to provide me with an FTP login on your FTP server with permissions to upload? It could be a separate account from your main one so that it is isolated. This would allow me to test and see if I can work out what is happening. You can send the details to me in a private message.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

bbrink
Pro Scripter
Posts: 70
Joined: Thu Dec 31, 2009 2:36 am
Location: Minnesota
Contact:

FTP files corrupt

Post by bbrink » Mon Feb 22, 2010 1:16 pm

Hi Marcus,

I have uploaded the files and notes to your "message" area.

Thanks again, I am realy looking forward to getting this resolved since it was this one job that compelled me to upgrade. If I cannot get this to work I will have to go out and find more things I can do just to justify the purchase ;)

Bob

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

Corrupted file here too

Post by Snickers » Wed Jun 27, 2012 9:43 pm

Was a solution ever found to this corrupted file issue?

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