Is it a good idea to use REST webservice to upload files?

java, jax-rs, jersey, rest, web-services

Solution

If you are concerned about safe access why you do not enforce authentication to the client ? You can implement a SecurityContext and use it in your Java code to access the authentication information. Take a look at this article could be helpful.

Problem

I am studying REST with JAX-RS, and this doubt just came to my mind: Since web services are meant to serve inter-operable clients written in different programming languages and the clients just use the URLs to access the services features; what about a web service for uploading files to a common database? Will it be save? How can the web service avoid being overloaded by spam if he has no control over how do the clients perform validation? The method for upload will look more ore less similar to this: ``` @Path("/upload/{something}") @Consumes("multipart/form-data") @POST public void uploadSomething(...) { //... } ``` So my doubt is if uploading is a good thing that REST services can do safely?

Original source