What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How do I get the file upload URL from POST data?Asked by PEvaluations on February 16, 2015 at 08:33 AM
If a form has a file upload (e.g. a photo) POST does not seem to include the URL to the file, just the name (e.g. photo.png). Is the submission ID available in the POST also? Perhaps that way I can use the API to pull the photo URL.
This is a re-post of a comment on Send Submission Data via POST Method Using PHP and the Thank You Settings
It is possible to get the submission ID from the POST data. I notice that the only file name is displayed in the POST data. However, since the files uploaded URL is similar and having the form ID, submission ID we can generate the file uploaded URL as below :
$url = "http://www.jotform.com/uploads/Account_Username/".$formid."/".$submission_id."/".$upload;
Here $formid, $submission_id and $upload are the variables to store the respective data from POST data.
For instance, the URL can be generated as below by concatenating these variables.
http://www.jotform.com/uploads/Kiran/50463987461969/299908918475243156/This is a test image.jpg
If you are allowing multiple files on the upload button, the upload field turns to an array.
Please take a look at the following demo form that displays the POST data and the generated URLs for both upload fields.
Hope this information helps. Please get back to us if you need any further assistance. We will be happy to help.