Menu

file upload, thanks in advance for your aide

Help
R M
2008-06-23
2013-06-03
  • R M

    R M - 2008-06-23

    Using the latest version, I am attempting to allow users to upload a file via the form. I have selected email as the notification. After a few test runs I still was not able to see the files in the default directory. I'm sure I am missing something. I just need file to appear in the online directory.
    Any help is greatly appreciated as well as your time.
    Reply via forum or email at reggie@nawnawson.com

    My form is located here: http://www.nawnawson.com/cdh/form/tmp/persistent/form35013/form.html

    The email displays the messsage below but the files do not appear in the default files directory:

    Your Name: Bob
    Your Child's Nickname: Bobbette
    How did you find out about our site?: test
    Picture Upload: http://www.nawnawson.com/form/tmp/persistent/form35013/files/ (original file name: )
    Email:
    Your State: reggie@nawnawson.com

    Why does it say (original file name)

     
    • TNTEverett

      TNTEverett - 2008-06-23

      Probably something went erong during generation.  It's a small form so the quickest resolution will be to send me a copy of the processor.php as an email attachment or just straight cut and paste text. 

       
    • R M

      R M - 2008-06-23

      Thank you for the super fast reply! below is the code

      <?php

      $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

      // File upload handling
      if($_FILES['field_4']['name']!=''){
      $field_4_filename = "file_4_".date("sihdmY").substr($_FILES['field_4']['name'],strlen($_FILES['field_4']['name'])-4);
      if(!move_uploaded_file($_FILES['field_4']['tmp_name'], "./files/".$field_4_filename)){
      die("File " .  $_FILES['field_4']['name'] . " was not uploaded.");
      }
      }

      mail("carla@babiesformrbarack.com","phpFormGenerator - Form submission","Form data:

      Your Name: " . $_POST['field_1'] . "
      Your Child's Nickname: " . $_POST['field_2'] . "
      How did you find out about our site?: " . $_POST['field_3'] . "
      Picture Upload: ".$where_form_is."files/".$field_4_filename." (original file name: " . $_FILES['field_4']['name'] . ")
      Email: " . $_POST['field_5'] . "
      Your State: " . $_POST['field_6'] . "
      Tell Your Friends!: " . $_POST['field_7'] . "

      powered by phpFormGenerator.
      ");

      include("confirm.html");

      ?>

       
    • TNTEverett

      TNTEverett - 2008-06-23

      OK, it's your form file that does not match your processor.php file.  I will send your new form file back as an attachment to your other email address. 
      This is a known issue that occurs when you create a form and during generation you move fields up or down or delete and add.  What happens is the field names in the form then no longer match the field names in the processor.php file.

       

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.