POST to PHP with enctype='multipart/form-data'

testeee2

New Member
NOTE: The issue was resolved, I was apparently editing the wrong file. Silly me. ThanksI am using an image upload script that posts file to the a PHP script that then saves the file to the server. Here is the upload form:\[code\] <form action="upload.php" method="post" name="image_upload" id="image_upload" enctype="multipart/form-data"> <input type="hidden" name="forumuser" value="http://stackoverflow.com/questions/3686917/testname" /> <input type="hidden" name="email" value="http://stackoverflow.com/questions/3686917/[email protected]" /> <input type="file" size="25" name="uploadfile" id="uploadfile" class="file margin_5_0" onchange="ajaxUpload(this.form);" /> </form>\[/code\]There is no submit as it is done through an AJAX call. The image is received and uploaded to the server, but my PHP script fails to actually receive any POST variables:\[code\]$forumuser = $_POST['forumuser'];$email = $_POST['email'];\[/code\]Echo'ing these variables result in nothing. This is likely do to the \[code\]enctype\[/code\], as I have found people who switched it have found that the POST variables will work but the file upload does not. None of the solutions in the PHP bug report have worked for me.Here are some settings in the ajax.js file:\[code\] form.setAttribute("target","uploadform-temp"); form.setAttribute("action",get_url); form.setAttribute("method","post"); form.setAttribute("enctype","multipart/form-data"); form.setAttribute("encoding","multipart/form-data");\[/code\]I appreciate any assistance.
 
Back
Top