JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
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.
Trying to Curl the image from CSV addressAsked by snaplash on November 19, 2015 at 11:51 AM
I have an automated system and use the csv file to harvest my data from users submissions
When a user submits an image the address in the csv is
I would like to use this address to curl the image to my system.
the address is really
stopping my from curl ing the image, can you guys suggest a fix please?
I presume you are referring to the PHP CURL operation.
Kindly try using the following PHP code, the function takes two parameters.
The URL of the image and the location the image is to be saved to.
Also ensure that the allow_url_fopen is enabled in your PHP settings.
Do let us know if this addresses your situation.
actually, I am using a shell script directly
I'm not very familiar with using the CURL directive in shell scripts, I did manage to run an example fetching the image link provided over HTTPS using the following command and was able to download the file
curl -o filename.jpg https://files.jotform.com/jufs/snaplash/53165496889980/323760246784118644/iStock.jpg
Here is the screenshot, I ran it in windows. Kindly try and see if it executes correctly on your end.
Yep, that works, but unfortunately that is not the problem. The address of the file in the CSV of the form is:
and that wont cURL because the file is located in
How do I get that address passed in my csv?
I do see the issue you are referring to now, on the browser the URL will be automatically redirected to the correct one but on CURL the redirection wont work.
Kindly add the -L which is a location header flag, this will allow the URL to resolve correctly for your file, here is an example.
curl -o filenameb.jpg -L http://www.jotform.com/uploads/snaplash/53165496889980/323760246784118644/iStock.jpg
Sammy! Thank you!
That is perfect!
Happy to hear the solution works.
If you do encounter any other difficulties feel free to let us know and we will happily assist.