golfer Posted December 5, 2010 Share Posted December 5, 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. Link to comment https://forums.phpfreaks.com/topic/220738-move_uploaded_file-error/ Share on other sites More sharing options...
ikin Posted December 5, 2010 Share Posted December 5, 2010 This is the php regex forum. Link to comment https://forums.phpfreaks.com/topic/220738-move_uploaded_file-error/#findComment-1143345 Share on other sites More sharing options...
BlueSkyIS Posted December 5, 2010 Share Posted December 5, 2010 /home/~unn_s003539/public_html/Sold/ is not the same as /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_s003539/public_html/Sold/ $target is not a valid path, thus Unable to move '/tmp/phpUWYU51' to '/home/~unn_s003539/public_html/Sold/uploadsPC45 close up .jpg' Link to comment https://forums.phpfreaks.com/topic/220738-move_uploaded_file-error/#findComment-1143359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.