When using HTTPCaller you can get a binary respons, for instance a PDF with _headers{13}.value (string): application/pdf . If you "Save Response Body To : FILE" the file gets created ok. However if you choose Save Response Body to: Attribute - and then writes this data with a AttributeFileWriter or a textfilewriter it does not get saved as PDF. Is there a "Generic Binary writer" that writes in similar way as the HTTPCaller does depending on the application/pdf type?
For the AttributeFileWriter, did you try setting the character encoding to fme-binary?
Or is it the filename extension that is the issue here?
David
For the AttributeFileWriter, did you try setting the character encoding to fme-binary?
Or is it the filename extension that is the issue here?
David
I'm with you here. I pointed a HTTPCaller to a PDF file and wrote _response_body to a file with the AttributeFileWriter. When the AFW encoding was set to System then the file wouldn't open. However, it did open when set to fme-binary.
Extension can be set OK - changing to binary I already tried - HOWEVER I forgot to set the HTTPCaller to response type to binary - now it works with the AttributeWriter.
Thank you @david_r
Now for the last part - is it possible to use the WRITER to Text File to behave in the same way?
Extension can be set OK - changing to binary I already tried - HOWEVER I forgot to set the HTTPCaller to response type to binary - now it works with the AttributeWriter.
Thank you @david_r
Now for the last part - is it possible to use the WRITER to Text File to behave in the same way?
Have you tried the DATAFILE writer? It seems generic and it does have a binary mode.
Have you tried the DATAFILE writer? It seems generic and it does have a binary mode.
Yes, DATAFILE was invented to do Binary. Should work.
I was trying to write a zip file from a BLOB in an ORACLE database. The AttributeFileWriter didn't work when the BLOB was read using an SQL executor and produced a corrupted file. On the other hand, when the BLOB is read using a proper ORACLE reader, the AttributeFileWriter writes the file perfectly.
Any idea on what could cause this and how I could manage to write my file when the BLOB is read from SQLExecutor?
Thanks, I hope it's not off topic...