cancel
Showing results for 
Search instead for 
Did you mean: 

Upload File directly from local machine in an Alfresco Workflow Task

ashpal19
Champ in-the-making
Champ in-the-making
In any of the existing workflows provided by alfresco the documents can be uploaded from the content repository. How to allow the user to directly upload document from his desktop during a particular step in the workflow.

I have developed a custom workflow and would like to allow users to upload directly from his machine into the workflow(bpmSmiley Tongueackage). Please provide some guidance on how to proceed with this issue? What are the changes that I would need to make or if someone has already done something similar please provide detailed steps on how can I achieve this.

Thanking you in anticipation. (Also I forgot to mention, for the workflow developed, I have also customized the Share-UI by modifying the file share-config-custom.xml)
5 REPLIES 5

romschn
Star Collaborator
Star Collaborator
You can customize your workflow task screen to have file upload component to achieve this.

ashpal19
Champ in-the-making
Champ in-the-making
Thank you for your response Ramesh. I can certainly customize the workflow task screen, however I will need additional help to complete this task. Are there some steps which I can follow? The upload document component will upload document to which folder? how will that document be attached to the workflow? Will I need to execute web-scripts or Java classes to attach the document to the workflows? I am little confused about how to go about this, hence I need some more help. Thank you.

Hi,
1) First you need to customise workflow task form to add "File Upload" control.
2) Once the user uploads the file, do HTTP Post to create document in alfresco repository.
3) If the http post is success, then get the noderef of the newly created document.
4) Use the nodeService to create the association between the newly created document and the bpmSmiley Tongueackage noderef.



        nodeService.addChild(bpmPackage.getNodeRef(), newlyCreatedDocumentNodeRef,
        WorkflowModel.ASSOC_PACKAGE_CONTAINS,
        QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,QName.createValidLocalName(fileName)));



Hope this helps you.

itica
Champ in-the-making
Champ in-the-making
I have the same problem

nyamang
Champ in-the-making
Champ in-the-making
Hi ashpal19,
I've the same problem by struggling to find out the solution.
I wonder whether you've found the solution. I would appreciate very much if you can share your findings with me.
Thanks in advance.
Nyam