I was wondering if anybody had any experience sending CSV files as binary on the HTTP Method node. When i upload them to a Sharepoint site whatever MIME type i use the file is corrupted/incorrectly formatted.
The workflow downloads the file from S3 and then writes it to binary to rename it and then reads it back in to send to Sharepoint. When i check the file written to disk its fine so it must be the upload that is causing the issue
That is quite weird that it works with PDF and not with CSVs. Can you try not setting the content type? When it’s not, the node can “guess” the content type instead of having “application/octet-stream” by default.
One question I have on this one, When you say it is corrupted what do you mean? I can see in your screenshot it is showing 1.93E+23 but the value of the cell that is cut out at the top looks to be 1.92xxxxxxx
If this is the issue I don’t think it is actually any kind of corruption and it is more than likely going to just be how Excel is displaying the data, If you were to download that file from sharepoint and open it in Notepad (other text editors are available) does it show the correct value?
It appears that a header and footer are being inserted in to the file as part of the upload process. I have opened a CSV file in TextEdit and its in the data (see below). I’m not sure if there is anything i can pass in the request that would stop this for CSV and also not sure why PDF’s are un-affected.
That is odd, I had assumed that they were just headers from whatever was generating the CSV.
Had a quick look online and I can see others have had the same issue and it looked to be around the content type but I can’t find any solid answer that you have probably not already tried. I don’t have a Sharepoint site set up for testing (I will get one setup this week) but out of interest do you get the same issue if you upload the same CSV file to Onedrive?
Yeah, the data does not have to be sent using multipart-form data but rather sending the raw binary data in the body. Can you try what I did in the example below?
Ok just noticed that the endpoint OneDrive is trying to use to upload a file it’s the same endpoint you are trying to use, meaning you should be able to upload the file using OneDrive specifically the file:update operation.
@RicardoE105 Sorry for the late response but i want to close this off and prevent anybody else having the same issue.
We resolved the issue by changing the authentication method from being inside the header in the request to use the authentication method Header Auth. This then meant it was not a multipart-form request and the files is upload as expected.