Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading files in RESTful way?

I'm designing a RESTful API that should handle binary file uploads.
Should this be done the same way as html form upload or is there a better way?

like image 879
yanchenko Avatar asked Jan 19 '10 08:01

yanchenko


2 Answers

Take a look at the Amazon api for an idea. It uses a PUT query and then through sendREST it sends the content. Uploading files to Amazon S3 with REST API

like image 195
Aggelos Biboudis Avatar answered Oct 06 '22 00:10

Aggelos Biboudis


A good way is to upload the binary information using streams. You could have a look at the JeCARS client project. To be exact the JC_RESTComm.java class performs the upload.

like image 37
Waverick Avatar answered Oct 06 '22 00:10

Waverick