Can I create a form that downloads a PDF if the user has put in the correct file name to download?

  • paineelectronics
    Asked on May 29, 2014 at 1:06 PM

    Is it possible within jotform to download a file from a website based on a validated file name?  We have customers that request specific files and it would be nice if they could just fill out a form and if the file name was correct, the appropriate pdf opened.  Is this possible?

  • TitusN
    Replied on May 29, 2014 at 3:04 PM

    Hello,

    Yes - this is possible.

    It depends on the following:

    1. How many PDF's we are talking about

    2. Do they have to know the file name?  - can't they select from a drop-down list - or what do you have in mind?

    3. Whether the PDF's are uploaded to a web-repository for easy download

    But in General - yes, this is very possible.

    Please clarify the questions above and we shall adivice further.

  • paineelectronics
    Replied on May 29, 2014 at 3:19 PM

    It would be 1 pdf per request.  They would need to know the exact name of the file and.... the files are all located in a central directory within our web directory.  We are trying to replace our old data request system with a much simpler process that does not rely on Office dll's. (http://www.paineelectronics.com/electroniccaldata.aspx)  

  • paineelectronics
    Replied on May 29, 2014 at 5:31 PM
    The challenge for us and for our customer’s security, is that we cannot have a populated list.  We have to have a field that a customer types his or her number(s) into that then compares itself to a file name within a directory.  If that name is found, the appropriate pdf is opened (specific to that one customer).  We currently do this with a heck of a lot scripting and it's a pain.  Our thought was that if we could design a simple form entry that could compare and then open a document, a whole world of opportunities could unfold for our customers.
  • jonathan
    Replied on May 29, 2014 at 9:49 PM

    Hi,

    How about if you instead use the form Send Post Data feature?

    User Guide: How-to-Post-Submission-Data-to-Thank-You-Page

    Can I create a form that downloads a PDF if the user has put in the correct file name to download? Image 1 Screenshot 20

     

    You can use the post data from the user provided filename (from the input field), and then use server side query to search the filename in your directory list.

    I found on the internet a solution that I think should work on what you require here.

    http://stackoverflow.com/questions/3321547/help-using-regexiterator-in-php

    To summarize, the design I have in mind is like this.

    1. Create your input form. Make sure to setup question for the filename data needed (a Textbox will do)

    2. Enable Send Post Data method in the form.

    3. In the form's Custom Thank you URL, redirect it to your PHP web page.

    4. Your PHP webpage should have a query code similar to what I was suggested here

    5. Once the correct filename output is captured, you can redirect the page again to the form or thank you page where the file URL path/link is now available for the form respondent to download.

    Please tell us if this solution can work for you.

    We can also provide you further assistance on the server side PHP code needed, should you like to proceed using this method.

    Thanks!

  • paineelectronics
    Replied on August 12, 2014 at 2:52 PM

    Unfortunately, this level of programming is beyond our capabilities.  Sure wish there was a simpler process.  Thank you for the input :-)