[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help: Transfer file error using FTPAPI



Hi Martina,

FTP does not send the file's description, it only sends the data. There is nothing in the data that tells how big the records should be. FTP merely sends a constant "stream" of data, and it's up to the receiver (in your scenario, that's presumably FTPAPI) to break the stream into records.

Since there's no "for certain" way to determine the length, when I was writing FTPAPI, I was faced with two choices:

1) I could receive the entire file into a stream file in the IFS, then read the entire file looking for the largest record, then create physical file with that record length (if the record length falls within valid record length range) and copy all of the data from the stream file to the physical file. This would require additional disk resources, and for large files could significantly increase the time of the transfer.

-or-

2) Simply pick a record length and save the data into it. And if that length was not correct, let the caller controlling FTPAPI specify a different one.


I chose the 2nd method, and chose to always use a record length of 1024 bytes.

If you have a better record length, simply pre-create an empty physical file with the proper length, and FTPAPI will use the length you selected.




On 7/1/2012 6:37 AM, Martina Carolina Alagna wrote:
    I use the get FTPAPI to transfer files from pc to as400; everything
    goes fine besides for the file record length: I get a file record
    length smaller on the AS400  than the original length on the PC.


    The record length on the PC is 1639 bytes, on the AS400 the GET
    transfers only 1024 bytes.


    What should I do to transfer the whole 1639 bytes record length ???


    Thanks.



    Cordialmente

    ______________________________________________

    Martina Alagna

    ArtMatica Italia srl

    zend-solution-partner-S

    uff.  06.4060.667

    cell. 348-0341087 e-mail [1]m.alagna@xxxxxxxxxxxx

    [2]http://www.artmatica.it

    P "Rispetta il tuo ambiente, pensa prima di stampare questa e-mail"
    " Please consider your environmental responsibility before printing
    this e-mail

References

    1. mailto:b.virzi@xxxxxxxxxxxx
    2. http://www.artmatica.it/



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
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
-----------------------------------------------------------------------