Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

how to upload file on Box Content API using httpclient?

Answered
New post

Comments

6 comments

  • cbetta

     I'm not sure I see an error trace here anywhere, just some Java and some HTML/JS. What exact error are you getting?

    0
    Comment actions Permalink
  • cheyrico2

       the response from Box is a 404 (File Not Found) with the the html body I've attached. I was expecting something else.

    0
    Comment actions Permalink
  • cheyrico2

    I can successfully upload file using postman. I Only need to provide an "Authorization" header and the body as form-data to have two entries.

    1. attributes - the JSON String shown above

    2. file - the binary of the file

    0
    Comment actions Permalink
  • cheyrico2

    Please ignore this issues as I had made a mistake in passing the URI. The I had the wrong URI

    0
    Comment actions Permalink
  • cbetta

    Ah great to hear. Sorry I wasn't able to help much more.

    0
    Comment actions Permalink
  • vighnesh_1711

     

     

    I am also facing the same issue. I am passing as below

    {"name":"abc.txt", "parent":{"id":"0"}}

     id : 0 means file uploading at the root level. what do you mean by this

    -F file=@myfile.jpg

    and where should I pass this? 

    0
    Comment actions Permalink

Please sign in to leave a comment.