Menu

uploaded jpg files given wrong URL

Help
nik
2006-03-22
2013-06-03
  • nik

    nik - 2006-03-22

    when one uploads a file via my form, the phpform generates an incorrect URL for the uploaded file.

    An example of the incorect file URL phpform generates is:
    http://files/07_29_22_kokoa's valentines.jpg (which always redirects me to http://whyfiles.org/ instead.)

    The CORRECT URL for the uploaded file should be:

    http://www.xxx.com/phpform/use/petstar_entry/files/files/07_29_22_kokoa's valentines.jpg (where 'xxx' is my domain name)

    Clearly, the form generator is not putting the directory path in front of the file name. How can I change this so that the email I get contains the correct URL of files which are uploaded using phpform generator?

     
    • TNTEverett

      TNTEverett - 2006-03-22

      You can edit the process.php file to make the necessary corrections, or you can send me a copy of this file and I will make the corrections for you.  Note that this is not normal and is probably due to some misinterpretation of the data you supplied when creating the form. 
      In any case I'm sure we can resolve your problem.

       
    • nik

      nik - 2006-03-22

      I can't figure out what in the process.php file needs changing...all I can find is a reference string of ".$where_form_is."files/".$image_list[xx]."

      If you don't mind, I'll send you the process files for both my forms...

      Thanks so much for all your help.

       
      • TNTEverett

        TNTEverett - 2006-03-23

        For whatever reason the $where_form_is variable is rearely accurate on many hosts.  For this reason you can hard code the variable to your form location. 
        Try changing this line in the process.php file:
        $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
        to this line:
        $where_form_is="http://www.xxx.com/phpform/use/petstar_entry/";

         
    • nik

      nik - 2006-03-23

      Works!!! Hey, thanks for your patience and all you help. Now that the security hole and the URL problem are fixed, the forms are working beautifully. Thanks again!

       
    • Greg

      Greg - 2006-06-20

      This has helped me also, however i added question

      When the email arrives it has the wheris link in the email generated from ".$where_form_is."files/".$image_list[2]." which is fine, however I have 5 uploads per submission, and if a user only uses 1 the next four are still shown with the link to nothing, is ther a way to have it not display the link in the email if a file was not uploaded for each upload field?

      Cheers

       
      • TNTEverett

        TNTEverett - 2006-06-20

        Anything is possible with a little effort.  Send me a note next week and I'll see if I can help you out.  I'm on vacation this week. 

         
    • Joshua

      Joshua - 2006-06-20

      Hi, I have the same problem.. could you assist me in making the proper change to the process.php file. The correspoding (existing) line on my process.php file reads:
      $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".

      and the location of the uploaded files seems to be:
      http://www.xxx.com/formgen/use/quest2/files/01_50_12_Photo%2022.jpg

      Thanks very much for your help
      Joshua

       
      • TNTEverett

        TNTEverett - 2006-06-20

        Did you check the post in this subject dated 2006-03-22 20:04?  If this does not help I'm going to need more information from you and possibly your process.php file.  Don't count on quick response.  I'm on vacation as of today.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.