Archived Forum Post

Index of archived forum posts

Question:

Issues with FTP and large files

Oct 23 '12 at 10:30

Using perl 5.10 on Centos 6.2 32 bit with the FTP2 module.

When trying to put a file using PutFile() onto a remote server I get the error "Failed to get local file size". The file is large at 2193626527 bytes.

If I try MPutFiles() I get the error <oserrormessage>Value too large for defined data type</oserrormessage>

Does anyone have any ideas as this is a transfer script that needs to handle all files sizes.

Thanks in advance


Accepted Answer

Here are the pre-releases with the changes I described above:

32-bit Linux Perl 5.10

multi-thread build: http://www.chilkatsoft.com/preRelease/chilkat-9.3.2-perl-5.10-x86-thread-multi-linux.tar.gz

single-thread build: http://www.chilkatsoft.com/preRelease/chilkat-9.3.2-perl-5.10-x86-linux.tar.gz


Answer

Thanks! The "stat" system call to get the file size failed. I did two things:

(1) Added logging to see the internal size of the "off_t" data type for the stat system call (see http://linux.die.net/man/2/stat ) and also logged the reason for the stat failure to LastErrorText.

(2) Allow the FTP upload to continue even if the local file size is unknown.

I'll provide a new build and post the link here ASAP.


Answer

Please post the full contents of the LastErrorText for the case of calling PutFile.


Answer

Here is the full LastErrorText for PutFile thanks

<chilkatlog> <putfile> <dlldate>Aug 7 2012</dlldate> <unlockprefix>PHENXSFTP</unlockprefix> <username>bottomless-pit:stanles</username> <architecture>Little Endian; 32-bit</architecture> <language>Linux Perl</language> <verboselogging>0</verboselogging> <localfilename>/u01/crimson-rec/simon.test</localfilename> <remotefilename>simon.test</remotefilename> <idletimeoutms>60000</idletimeoutms> <receivetimeoutms>60000</receivetimeoutms> <connecttimeoutseconds>60</connecttimeoutseconds> <error>Failed to get local file size.</error> <localfilepath>/u01/crimson-rec/simon.test</localfilepath> </putfile> <totaltime>Elapsed time: 0 millisec</totaltime> <error>Failed.</error> </chilkatlog>


Answer

Sorry forgot the tags

<chilkatlog>
<putfile>
<dlldate>Aug  7 2012</dlldate>
<unlockprefix>PHENXSFTP</unlockprefix>
<username>bottomless-pit:stanles</username>
<architecture>Little Endian; 32-bit</architecture>
<language>Linux Perl</language>
<verboselogging>0</verboselogging>
<localfilename>/u01/crimson-rec/simon.test</localfilename>
<remotefilename>simon.test</remotefilename>
<idletimeoutms>60000</idletimeoutms>
<receivetimeoutms>60000</receivetimeoutms>
<connecttimeoutseconds>60</connecttimeoutseconds>
<error>Failed to get local file size.</error>
<localfilepath>/u01/crimson-rec/simon.test</localfilepath>
</putfile>
<totaltime>Elapsed time: 0 millisec</totaltime>
<error>Failed.</error>
</chilkatlog>

Answer

The error here has nothing to do with FTP. It's simply a local file problem -- probably an incorrect path for the file in the local filesystem. Notice the word "local" in the error:

<error>Failed to get local file size.</error>
<localfilepath>/u01/crimson-rec/simon.test</localfilepath>