Error Uploading File exceding 1MB

SOLVED
Go to solution
Highlighted
New Contributor

Error Uploading File exceding 1MB

Using the box API, I am trying to upload a file using the curl

 

curl -X POST https://upload.box.com/api/2.0/files/content \
     -H 'Authorization: Bearer <ACCESS_TOKEN>" '
     -H "Content-Type: multipart/form-data" \
     -F attributes='{"name":"Photo.jpg", "parent":{"id":"11446498"}}' \
     -F file=@<FILE_NAME>

 

I am receiving the following error:

 

{"code":"bad_request","help_url":"http://developers.box.com/docs/#errors","status":400,"message":"non-file POST form-data field exceeds set limit of 1000000 bytes"}

 

 Why does it say that the limit is 1MB?

In the box api documentation says that the file has to be less than 50MB and my file has about 5MB

Thanks.

Tags (3)
1 REPLY 1
Box Employee

Re: Error Uploading File exceding 1MB

Hi @danielrod99 I just gave this a test as well and it seems to work fine:

 

curl -X POST https://upload.box.com/api/2.0/files/content \
     -H 'Authorization: Bearer hXLolSiUKjMSA9CBDwpIcYU23y0XMr6e' \
     -H "Content-Type: multipart/form-data" \
     -F attributes='{"name":"File.pdf", "parent":{"id":"0"}}' \
     -F file=@file.pdf

 

I did notice that your code had an extra double-quote in the Authorization header at the end. This might have caused some weirdness to occur.

 

Also, it seems the error does not seem to point at an issue with the file size being too large, but with the non-file data (the attributes field). Can you please retry and verify the full command you used?


---
Developer Advocate @ Box