Highlighted

Save attachements to a specific folder on the server

_jerome_dinnat_

23-03-2009

Hi,



I need in a process to upload files from a user to a specific folder on a server.



My first idea was to use the attachments tab into workspace to add the files. I was able to save the attachments into the folder in the workbench after a step validation.



The problem was that the attachments are saved in database or GDS and the size grows up too big.



My second option was to use the javascript methods importdataobject and exportdataobject into the pdf.



I can import the files in the pdf.

But there is two problems :



- the folder destination can't be choosen. The user must selected the folder. The CDIpath option is no longer available for the exportobjectdata.



- I can't save all type of attachments. The EXE files etc can't be saved even if I checked options in the Reader.



How can I upload this files ?



Thanks for any help.

Replies

Highlighted

pguerett

23-03-2009

You can have them in the PDF (so that they are not stored in the DB). There are other services that exist to allow you to extract the attachments (see the processFormSubmission in Forms or the Execute DDX in Foundation). Once you have the files extracted, you can use the File Utilities in Foundation to create a directory and write these attachments out to the file system.
Highlighted

_jerome_dinnat_

23-03-2009

Hi Paul,



When you say : "You can have them in the PDF (so that they are not stored in the DB)"



You mean by using the importObjectData method in javascript or the paperclip because I'm able to import the files in my PDF but not to save them in a specific folder.



The exportObjectData not allow me to save the files in a folder without a user selection and I am not able to save EXE files for example.



I try to use the submit pdf form es update 1 but I'm not able to retrieve the attachments.



I can retrieve the attachments after an assign task and use the file utilities to write whose I need on a folder. I try the same way with processFormSubmission but with no results.



EDIT : The variable "sources" of type List/Documents is still empty.



Thanks for your help.
Highlighted

pguerett

23-03-2009

Yes ...you attach them using the paperclip then you can use one of these two methods to get the attachments out. Note that you have to modify the submit button to send back PDF not XDP. Then you can get the attchments out of the PDF using Assembler (a DDX control file is required) or processFormSubmission.



If you still are having issues send the LCA file and the PDF with attachments to this email address and I will have a look.



livecycle8@gmail.com
Highlighted

_jerome_dinnat_

24-03-2009

Hi Paul,



First of all thanks for you great help.



So I remove the process field object from my form to put a submit button to send back PDF. I suppose I can't use the form without workspace now because I don't have the route list etc...



I change the xfaform variable to a Document Form variable.



I'm able put all of kind of file in the form with the method importObjectData but with the paperclip I can add Exe or jar file for example.



I retrieve the attachments in the submit orchestration and store them in a local folder.



But the attachments are still stored on the DGS permanently.



How can I remove them during the submit process ?



Thanks again
Highlighted

pguerett

24-03-2009

They exist in the GDS while they are in the process as a document variable. The GDS is cleaned at a set intervale (Document sweep interval)...so they do not exist permanently.
Highlighted

_jerome_dinnat_

24-03-2009

My interval is set to 600 seconds but the attachments are not clean up. I can retrieve the attachments but there are still in the Form.



So if I go to the tab audit in workspace, I can see the attachments into the form. So they can be delete by Livecycle ? Am I wrong ?



What I want is to delete them after I stored them in a local folder.



Thanks
Highlighted

_jerome_dinnat_

25-03-2009

Hi,<br /><br />In fact, it doesn't work. The file attachments are still embed in the pdf.<br /><br />I use the "Invoke DDX on one document" service after the "FormSubmission" service in my submit service.<br /><br />I though it was working because when I click on the paper clip the attachments doesn't appear anymore. I use the "getPDFproperties" service after the DDX operation to check for attachments in my document. The answer is false, there are no attachments.<br /><br />But the form still make the size of the attachments and I can see the attachments in the GDS.<br /><br />My DDX document : <br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><DDX xmlns="http://ns.adobe.com/DDX/1.0/" ><br /> <PDF result="outdoc"><br /> <NoFileAttachments/> <br /> <PDF source="inDoc"/><br /> </PDF><br /></DDX><br /><br />For the DDX service : <br />My input is the output document from the processFormSubmission.<br />My output is an new document called outdoc.<br /><br />I use the getPDFproperties on the outdoc document.<br /><br />Did I make a mistake ?<br /><br />I'll look to other solution like upload my files using a web service(but it seems not easy) or to delete the attachments from the database or the GDS when the process is completed or terminated (it seems even harder and risky).<br /><br />Thanks for your help.