cancel
Showing results for 
Search instead for 
Did you mean: 

File upload from browser

dasjlm
Champ in-the-making
Champ in-the-making
I'm not having a lot of luck figuring out how to upload a file into the repository via a web service.


I can read a file from the web server and save in the repository, but how does a remote app read a local file on their pc and save in the repoistory.

I think I suppose to exploit the UploadContentServlet but I'm not sure if I need to upload the file first?

Is there a good sample of remote web app that gives user the ability to select a local file, then upload it and save to the repository.


Thanks in advance.
JLM :?:
3 REPLIES 3

dasjlm
Champ in-the-making
Champ in-the-making
A short snippet of code showing the use of the ContentUploadServlet would be a hudge help.  If anyone has one I'd really appreicate not having to reinvent the wheel.

tim-erwin
Champ in-the-making
Champ in-the-making
There is a possibility to upload content via webservice as demonstrated in the ContentReadAndWrite example. Why should I use the servlet?

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

There are a couple of reasons for using the servlet over the write() method on the content web service:

- In order to add the binary data to the web service request the entire file must be read.  If it is a large file then running out memory in the client JVM is a possibility.
- Web service requests made via Axis have a maximum size, so limiting the size of files sent.  Streaming of requests is not supported by Axis.

Using the servlet allows the content to be streamed into the repository content store using a standard PUT HTTP method.

See http://forums.alfresco.com/viewtopic.php?t=7403 for some more discussion on this topic.

Cheers,
Roy