MS-DOS

Moderators: blip
Number of threads: 389
Number of posts: 904

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
FTP rar file corruption Posted by forsberg94 on 17 Apr 2010 at 1:32 AM
Hi all - I have written a batch file that uses the rar command to archive a folder with a bunch of files in it.

This file then needs to be sent to my ftp server.

I can successfully connect to my ftp server and 'put' files on it with no problems...

However, the problem comes when I try to upload a .rar file. The file sends to my ftp server and seems to have no problems, but when I pull it off and try to extract it it tells me the following:

! C:\Users\Christopher\Desktop\wrar393.rar: CRC failed in wrar393.exe. The file is corrupt
! C:\Users\Christopher\Desktop\wrar393.rar: Unexpected end of archive

This is just a test archive I made (archived the wrar.exe file and sent it as a .rar file)

So the problem here is definitely within the dos FTP client because when I use FileZilla, it woks perfectly fine.
If i upload the file through ms-dos and download it through ms-dos it gives me the error
If i upload the file through filezilla and download it through ms-dos it gives me the error.
If i upload the file through ms-dos and download it through filezilla it gives me the error
If i upload the file with filezilla and download with filezilla it does not give me error

So it seems as soon as it passes through ms-dos's FTP it is corrupting it. (or something is happening)

I have tried this on both Windows 7 and Win XP and same issues on both as well as crossing over (download/uploading on the different machines)


I'm using this within the command prompt:
ftp
open XXXXX.com
userXXXXXXXname
passXXXXXXXword

lcd C:\Setup_Files
cd qbooksbackup
put qbooksbackup.rar
(It then proceeds to finish and say a certain byte size was transferred in a number of seconds, etc.)

Any Help Please!

Thank you so much in advance!

- Chris
Report
Re: FTP rar file corruption Posted by forsberg94 on 17 Apr 2010 at 3:29 PM
Got it to work.... needed to set it to binary mode:




ftp
open XXXXX.com
userXXXXXXXname
passXXXXXXXword

lcd C:\Setup_Files
cd qbooksbackup
binary
put qbooksbackup.rar
Report
Re: FTP rar file corruption Posted by PatrickMc2008 on 29 Apr 2010 at 8:22 AM
Yes, .rar is binary.

If you want to upload a directory structure without .raring the files (sometimes, this is needed to preserve the timestamps), you can use an automated script like this.


http://www.biterscripting.com/helppages/SS_FTPUpload.html






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.