CJ - Twitch Posted February 22, 2010 Posted February 22, 2010 Im having problem with this code... <?php $name = $_FILES['uploaded']['name']; $target = "files/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file $name has been uploaded! Link: http://rippedgfx.co.cc/files/$name"; } else { echo "Sorry, there was a problem uploading your file."; } ?> Can you help? Quote
a_bertrand Posted February 22, 2010 Posted February 22, 2010 What's the problem? What doesn't work? Quote
CJ - Twitch Posted February 22, 2010 Author Posted February 22, 2010 I get this error. Warning: move_uploaded_file(files/Chrysanthemum.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/********/public_html/***************/upload.php on line 6 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phptPkWAH' to 'files/Chrysanthemum.jpg' in /home/********/public_html/***************/upload.php on line 6 Sorry, there was a problem uploading your file. Quote
a_bertrand Posted February 23, 2010 Posted February 23, 2010 Well maybe your apache user don't have write access to this files directory? Quote
CrazyT Posted February 23, 2010 Posted February 23, 2010 Your "files" directory needs to be chmod to 755 or 777 is it? or as a_bertrand said. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.