cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer a file to ALFRESCO from a java application

pavan
Champ in-the-making
Champ in-the-making
Hello Experts,

    I am fairly new to ALFRESCO and wanted to know how I can transfer data..say a file to ALFRESCO system from a java application. I just wanted to have some heads up on this one as there is lot of information in docs.

    So, I kindly request you to show me a starting point where I can read some relevant stuff reg.  this integrations.

Thanks,
Pavan.
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
Hi Pavan,

Yes there are various ways to do that.

Webscript (REST based webservices) is probably one the simplest way I found.

http://wiki.alfresco.com/wiki/Web_Scripts
http://wiki.alfresco.com/wiki/Web_Scripts_Examples

You can even check for the SDK examples for achieving the same.
http://wiki.alfresco.com/wiki/Alfresco_SDK

hardik_t_mistry
Champ in-the-making
Champ in-the-making
Hi Pavan,

web script is the easiest way through which you can upload a document to alfresco from external application. I did the same in my previous project. You will need to create a POST web script which will accept file as form-field parameter. Also you can send metadata(custom properties related to file) in request. In web script implementation class, you will need to get file object from request with as form-field data, get its <java>InputStream</java>, create a node, write the file <java>InputStream</java> to this node with the help of <java>ContentWriter</java> which you will get from <java>ContentService</java>. As you are adding something into alfresco, you will need to provide authentication. This can be done by attaching ticket with request.