Expand my Community achievements bar.

Saving copy of edited form on server

Avatar

Level 1

I am trying to allow website visitors to open a pdf form, apply input then save the changed form in a specified directory with a new file name (time and date stamp). I would like a complete copy of the entire pdf document saved - not just form data. I am fairly adept at javascript and php coding - have tried using the onclick event with a standard button and saveAs() js function but I get nothing.

topmostSubform.Page5.Button1::click - (JavaScript, client)
var folder = "/submittals/";
var d = new Date();
var fname = d.getMonth() + "-" + d.getDate() + "-" + d.getFullYear() + "_" + d.getHours() + "-" + d.getMinutes() + "-" + d.getSeconds();
var outputpath = folder + fname + ".pdf";
this.saveAs(outputpath);
window.location = "http://somesite.com/submittal-acknowledgement.php";

I have tried setting the button control type to submit then submit as PDF using some php code to retrieve the file - but I do not know what to retrieve it as.. POST variables does not work.. There are a lot of variables on the form so I would rather not iterate through the document.

Just retrieve the modified file, change the name and place it in a directory on the server.

I have looked through the forums for 2 days now and seen a <cfdocument> reference. I beleive this refers to Cold Fusion which I know nothing about.

Any suggestions or help in the right direction would be appreciated.

Thanks.

0 Replies