I want to upload video and images in database on server. I used following code, but when I use this code in my localhost
then it works but when I upload through the server, it shows errors.
Here is my code:
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ".basename( $_FILES['uploaded']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
And here are the error messages:
Warning: move_uploaded_file(upload/logo.JPG) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\vhosts\hiznherzbridalshow.com\httpdocs \hiznherz_new\test2.php on line 31
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
'C:\Windows\Temp\php7648.tmp' to 'upload/logo.JPG' in C:\Inetpub\vhosts \hiznherzbridalshow.com\httpdocs\hiznherz_new\test2.php on line 31