The Community is undergoing a major upgrade. Find out more, or let us know what you think here.
Forum Discussion
Amicao
3 years agoExplorer | Level 3
How to upload file via Curl with Binary object input?
Hello, good evening for all. I would like to know, how I can to upload file using a Curl request, or PHP Curl request, with the upload file request.
But instead I use the parameter o filepath, I us...
Greg-DB
Dropbox Staff
karanag In your code, you're sending the data in your 'content' variable, which just contains the string '"@" + imagePath', not the actual file data at that path. In the examples in the Dropbox API documentation, the "@" is a way of telling curl on the command line to read from the local filesystem at that path. That wouldn't necessarily work in other environments, such as using XMLHttpRequest like you are here. You'll need to update your code to pass in the actual file data. Please refer to the documentation for your platform for information on accessing file data.
karanag
3 years agoExplorer | Level 4
Ahh, thanks! Will do a deep dive into the documentation
About Discuss Dropbox Developer & API
795 PostsLatest Activity: 2 days ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!