PDA

View Full Version : Error Msg: Can't save file, or move it



tsk928
25-Oct-2006, 10:29 PM
Hi, my sample form worked great. I'm trying to implement this in a different form with file uploading. The script seems to try to create a temporary directory to save the file to, then tries to move it to my specified directory. This is where the error occurs.

The following error occurred in FormMail :
Failed to save file '/tmp/php2bpJlI' to '/php/muploads/25-Oct-pic1.jpg': Unable to move '/tmp/php2bpJlI' to '/php/muploads/pic1.jpg'

Do I just have the paths wrong or something? I'm really confused. I called my hosting provider and they say I have no temporary directory. So, I tried the SCRATCHPAD thing, and it didn't work.

Any ideas what I can do?

Thanks!

Karen

tsk928
26-Oct-2006, 01:01 AM
Also, this may help...

I checked chmod and it's ok. I checked "file_uploads = On" in my php.ini file. I called my host and they have no idea what's wrong, they say (of course) it's in the script. Here's where I've amended the script; if you need addl. info, please let me know. BTW, I can't get uploads to work on other scripts either. I've also attached the script, which I've renamed ModUpload.php.

define("CHECK_FOR_NEW_VERSION",false);

$SCRATCH_PAD = ""; (not sure exactly what to put here I tried www.mysite.com/tmp (http://www.mysite.com/tmp) - didn't work)

$FILE_REPOSITORY = "/php/muploads";

define("FILEUPLOADS",true);

And lastly is the form snippet from my html;

<FORM METHOD="POST" ACTION="http://www.mysite.com/php/ModUpload.php (http://www.mysite.com/php/ModUpload.php)" ENCTYPE="multipart/form-data" name="ModUpload">
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
<input type="hidden" name="recipients" value="supportLXSKKLmysite.com" />
<input type=hidden name="subject" value="Model Upload">
<input type=hidden name="redirect" value="http://www.mysite.com/thankyou.html (http://www.mysite.com/thankyou.html)">
<input type=hidden name="required" value="childname,email,first_file">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input type="hidden" name="file_names" value="first_file=%date%.first_file" />
Child's Name: <input type="text" name="childname" size="20" maxlength="40" value="">
Email: <input type="text" name="email" size="20" maxlength="40" value="">
<br><br>
Photo 1:<INPUT TYPE="file" NAME="first_file"><br>
Photo 2:<INPUT TYPE="file" NAME="second_file"><br>
Photo 3:<INPUT TYPE="file" NAME="third_file"><br>
Photo 4:<INPUT TYPE="file" NAME="fourth_file"><br>
Photo 5:<INPUT TYPE="file" NAME="fifth_file"><br><br><br>
Note: Please be patient when pressing submit. The upload will take a few minutes or more to process. Please do not click the submit button more than once, it will only delay the upload. If there is a problem uploading, please let us know.<br><br>
<input type="submit" value="Start Upload">
</form>


I'm getting very discouraged here, to the point where I'm almost in tears and don't know what else to do but give up entirely. Your help would be greatly welcomed.

Sincerely,

Karen

david_de
26-Oct-2006, 04:53 AM
Check this (http://www.tectite.com/vbforums/showthread.php?t=1271&highlight=upload) post where a couple guys were having similar trouble and figured it out in the end.

tsk928
26-Oct-2006, 01:05 PM
Thank you. I was given wrong information by my hosting company as to the path to my files. I found a phpinfo script that I ran, and found the actual correct path, and now the script works! :)