golfer Posted December 6, 2010 Share Posted December 6, 2010 I have been trying to upload videos using the move_uploaded_file function but have come up with a new error which is displayed below. Warning: move_uploaded_file(/home/~unn_s003539/public_html/Sold/uploadsPC45 close up .jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_s003539/public_html/Sold/vidupload.php on line 25 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpUWYU51' to '/home/~unn_s003539/public_html/Sold/uploadsPC45 close up .jpg' in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_s003539/public_html/Sold/vidupload.php on line 25 Error when uploading the video./var/www/vhosts/numyspace.co.uk/httpdocs I don't understand why this error is occuring as the file target I'm using is exactly the same as the one in the ftp file which I have just copied across. My code looks like this: session_start(); include("connection.php"); $target = "/home/~unn_s003539/public_html/Sold/uploads"; $target = $target . basename( $_FILES['video']['name']); $name=$_POST['name']; $email=$_POST['email']; $title=$_POST['title']; $description = $_POST['description']; $pic=($_FILES['video']['name']); $sql="INSERT INTO `videos` (name, date, email, title, description, video) VALUES ('$name','CURDATE()', '$email', '$title', '$description','$pic')" ; $result=mysql_query($sql); if(move_uploaded_file($_FILES['video']['tmp_name'], $target)) { echo "Successful upload of ". basename( $_FILES['video']['name']); } else{ echo "Error when uploading the video."; }. Any Help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
golfer Posted December 10, 2010 Author Share Posted December 10, 2010 Anyone? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2010 Share Posted December 10, 2010 Your path clearly is not correct. Your full path is (gotten from the part of the error message where your page is at) - /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_s003539/public_html/Sold/vidupload.php You are tying to use the following destination - /home/~unn_s003539/public_html/Sold/uploadsPC45 close up .jpg You are missing /var/www/vhosts/numyspace.co.uk/web_users from the front of the absolute file system path you are trying to make OR you would need to remove all of that and make it a relative path from where your vidupload.php is located. Quote Link to comment Share on other sites More sharing options...
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.