Jump to content
php.lv forumi

upload permisions


ViszinisA

Recommended Posts

Warning:  move_uploaded_file(/var/www/images/jaunumi/test.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /var/www/admin/up.php on line 8

Warning:  move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php3yWWjz' to '/var/www/images/jaunumi/test.jpg' in /var/www/admin/up.php on line 8

 

upload scripts... (nokopeeju no php.net)

If (isset($_FILES))
{
  $uploaddir = '/var/www/images/jaunumi/';
	$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

	echo '<pre>';
	if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
	   echo "File is valid, and was successfully uploaded.\n";
	} else {
	   echo "Possible file upload attack!\n";
	}

	echo 'Here is some more debugging info:';
	print_r($_FILES);
}
?>
<form enctype="multipart/form-data" action="?id=up" method="POST">
Bilde: <input name="userfile" type="file"><br>
<input type="submit" value="Upload">
</form>

 

 

kas kur jaauzliek vai jaapamaina?

Link to comment
Share on other sites

×
×
  • Create New...