[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need Help with FTP API - Getting error with SIZE
Hello Dan,
The 'SIZE' command is not available in all FTP implementations, it's an
extension to the protocol. The only way FTPAPI can tell whether the
server supports (or doesn't support) SIZE is by sending the command,
and checking the response to see if it's supported. And that's what it
does.
It sends SIZE, and if it's unsupported it ignores the error and
continues. I can't see why you'd get a timeout error here...
Please generate a session log. You do that by adding FTP_log(*on) to
your progam, just before you connect to the server. Then look at the
output of the log (which is in your job log) and I think you'll see
that the timeout is occuring on RETR rather than SIZE. At least, that
would be my guess...
If it's not, and you're truly getting the error on the SIZE command
then please tell me how to reproduce the problem, as I've never seen
that happen, and can't do anything about fixing it if I can't reproduce
it.
-SK
On 12/13/2012 9:53 AM, Dan Dan wrote:
I'm trying to do a Get Command, the file that I need is on a Windows
FTP server.
Now that I'm trying to GET the PDF file that I placed on the server it
fails.
I've tracked the issue down to the point that a send is done requesting
the SIZE of the file.
*Change to Binary Mode
c callp ftp_binaryMode(sess: *on)
*Change Name Format to 1
c callp ftp_NamFmt(sess: 1)
* Get the Requested file
c if ftp_get(sess: SendFrom:SendTo)<0
SendFrom= /00000010000007009747180009010910909.pdf
SendTo = /pdf/00000010000007009747180009010910909.pdf
Looks like all goes well until the SIZE is requested
* get total number of bytes to receive
c eval wkTotBytes = FTP_size(peSocket :
c peRemote )
* send size command:
c if SendLine(wkSocket: 'SIZE ' + peFile)<0
c return -1
c endif
* 213 <byte size>
c eval wwReply = Reply(peSession: wwMsg)
***** Connection Times out while waiting on response ****
***** What was sent in SendLine ***** = SIZE
/00000010000007009747180009010910909.pdf
NOTES:
1) I'm currently using this same API to do a PUT from the AS400 to this
Windows FTP server w/o any issues.
2) I used FTP on the AS400 and was able to transfer this file from the
Windows FTP server to the IFS on the AS400.
3) I issue the BIN and NA 1 commands before I request the GET. They
apear to work.
Thanks in advance for any help you can supply.
Dan
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[1]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------