Hi all,
I am trying to upload a PDF to a project using HTTPie and only the raw Base64 data. I am able to successfully perform this action in the boilerplate on the documentation page, but when I copy and paste the code into my environment, it returns this error: “file: File is not an object”
During earlier testing, I found that if I change the given form-data headers a little bit, I can get a successful result:
`
-----011000010111000001101001
Content-Disposition: form-data; name=“file”; filename=“testPDF.pdf”
Content-Type: application/pdf
[Base64 Data]
-----011000010111000001101001
Content-Disposition: form-data; name=“parent”
[Object/Project Parent GID]
-----011000010111000001101001–
`
This successfully attaches a PDF item with the title ‘testPDF.pdf’, but the file is corrupted. This is because there is nothing telling Asana’s environment to interpret base64 data. With the environment I am working in, I do not have the ability to convert the base64 data into binary, nor decrypt the base64 data into the RAW PDF data.
My question is, how come the code works in the boilerplate on the documentation page but not in another environment, and is there a form-data header I can use to tell Asana that the payload is base64 data?
Any input on this topic is greatly appreciated.
Thank you,
C