Jump to content

move_uploaded_file Error


golfer

Recommended Posts

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

/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'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.