Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error uploading file

Status
Not open for further replies.

EagleM

Programmer
Jan 17, 2007
31
0
0
US
I tried this on my Windows machine and it works fine. The only thing I changed for the Linux was the upload directory path from:
$uploadDir = "C:\\xampp\\xampp\htdocs\upload\\";

to:
$uploadDir = "/home/w/i/wiroton.com/html/images/";

The error it gives is:
"Warning: move_uploaded_file(/home/w/i/wiroton.com/html/images/5bfa_1[1].JPG):
failed to open stream: Permission denied in
/home/w/i/wiroton.com/html/insert_show.php on line 58

Warning: move_uploaded_file(): Unable to move '/tmp/phpL16PYy' to
'/home/w/i/wiroton.com/html/images/5bfa_1[1].JPG' in
/home/w/i/wiroton.com/html/insert_show.php on line 58
File upload failed:"

Line 58 has:
$result = move_uploaded_file($tmpName, $filePath) or die ('File upload failed: ' . mysql_error()) ;

What could it be? Anything to do with permissions?

Thanks
 
I got it. The directory didn't have write permission.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top