question

Nick Craig-Wood avatar image
Nick Craig-Wood asked

Can't upload empty file with REST API

I can't upload an empty file with the REST API. It is possible with the web interface so I guess there is some trick to it! I get "400 Bad Request", reponse body: {"message":"Bytes not received for request."} I tried both uploading a new object (with POST : { {contentUrl}}/nodes) and modifying an existing one (with PUT : { {contentUrl}}/nodes/{id}/content) My code works fine as long as the file as >0 bytes in! Any ideas anyone? Thanks Nick
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Craig-Wood avatar image
Nick Craig-Wood answered
Here is the HTTP transaction ------------------------------------------------------------ POST /cdproxy/nodes?suppress=deduplication HTTP/1.1 Host: content-eu.drive.amazonaws.com Content-Type: multipart/form-data; boundary=9c9e08290e3b552e29df043cb2dfaa1df47a92810acc74df901f9da7633d User-Agent: rclone/v1.19 --9c9e08290e3b552e29df043cb2dfaa1df47a92810acc74df901f9da7633d Content-Disposition: form-data; name="metadata" {"name":" empty2.txt","kind":"FILE","parents":["K8_fmN4dS5uEg5XXXXXXXX"]} --9c9e08290e3b552e29df043cb2dfaa1df47a92810acc74df901f9da7633d Content-Disposition: form-data; name="content"; filename=" empty2.txt" Content-Type: application/octet-stream --9c9e08290e3b552e29df043cb2dfaa1df47a92810acc74df901f9da7633d-- ------------------------------------------------------------ HTTP/1.1 400 Bad Request Content-Length: 45 Connection: keep-alive Content-Type: application/vnd.error+json Date: Mon, 07 Sep 2015 19:09:04 GMT Server: Amazon-Cloud-Drive X-Amzn-Requestid: e637cb4a-f13f-418a-94c4-e11195a095dd {"message":"Bytes not received for request."} ------------------------------------------------------------
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for your patience, and thanks for posting. It looks like this is by design! Regardless, I've passed your feedback on to the team. Regards, Jamie
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.