We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26401
    • 247 Posts
    I’m trying to get this to upload a file and change the file name to a a &runSnippeunique name

    I’m calling
    &eFormOnBeforeFormParse=`populate_hidden_fields` &eFormOnBeforeMailSent=`save_file` &runSnippet=`uploadForm_processor`


    this is my input inside the form
    <input type="file" name="uploadfile" id="uploadfile" value="" eform="uploadfile::"></input>


    and inside the save_file function I have

    function save_file(&$fields){
    	echo (generate_id());
    	echo ("\n\n\n");
    	var_dump($fields);
    	echo ("\n\n\n");
    	var_dump($_FILES);
    }


    the first var_dump is fine, except the file name ends up being a single character (not part of filename) and the $_FILES returns
    array(0) {
    }

    any idea what I’m doing wrong ?

    Thanks in advance
      • 10713
      • 41 Posts
      I have the exact same problem (Single character, empty $_FILES).

      Can you tell me how you solved it?
        • 10713
        • 41 Posts
        Okay, I also got it. It was the missing enctype atribute in my form template...
          • 27700
          • 1 Posts
          I always got this problem now.

          Can you tell me how you solved it?
            • 26401
            • 247 Posts
            sorry guys, I wish I remembered what I did. In retrospect I should have specified what I’ve done. If I remember correctly (though I could be wrong) it had something to do with the folder permissions