How to transfer a file to ALFRESCO from a java application

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2013 03:26 PM
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.
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.
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2013 10:31 PM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2013 06:36 AM
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.
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.
