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

Re: What is the best way to append data to IFS File ?



Hiya W-4038,

Can you explain what sort of data you're receiving? http_get() can receive any sort of data, but these are the types of data that I most frequently use it for:

1) XML
2) HTML
3) JSON
4) Images (JPG, GIF, PNG)
5) Zip/Tar files
6) PDF documents
7) Excel documents
8) Text (including CSV)

Of these, only the last one (plain text) can be appended to previously retrieved data without creating a syntax error the internal structure of the document. To append related data in any of the other formats would require knowledge of the format itself, and specialized processing to combine the documents correctly. As such, HTTPAPI was not designed to append data.

Assuming your data is plain text (or some other format that can be legitimately combined), then you can code this yourself. Receive the data to a temporary file, and then use a tool like QShell's "cat", or the IFS APIs (as discussed in the article you reference) to append the contents of the temporary file to another existing file.

Hope that helps!


On 8/6/2012 6:56 PM, w 4038 wrote:
    hi
    What would be the best way to log or append retrieved information to an
    IFS file?

    I have a pgm that uses http_get to get information from a web service:
    example:
             returnCode = http_get(request :IFS_File)

    At this point, the data is in the IFS_File.  So far, so good.
    But when the pgm issues http_get again, the IFS_File is cleared
    and new information is put in the IFS_File.

    How can the pgm append the new information to the IFS_File?
    Would the Addto command be the best route?
    (Written by S Klement, Nov 2006, Article # 53547)

    Or is there a better suggestion?



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------