Jump to content

php simple upload


bahearn

Recommended Posts

The upload works but the file's read permissions are screwed up any idea's ?

 

if($_SERVER["REQUEST_METHOD"] == "POST")
{
    $uploads_dir = 'images/';
$tmp_name = $_FILES["file"]["tmp_name"];
$name = $_FILES["file"]["name"];
	move_uploaded_file($tmp_name, "$uploads_dir/$name");
	$filename = "images/" . $_FILES["file"]["name"];
$finished = $filename;
}

Link to comment
https://forums.phpfreaks.com/topic/168302-php-simple-upload/
Share on other sites

Posting the actual error message would help.

 

If the images/ folder was created using an FTP client or your hosting control panel, it probably has a different owner than the user that the web server/php is running under. You either need to change the permissions on it so that php can access it or change the owner to be the same one as the web server/php.

Link to comment
https://forums.phpfreaks.com/topic/168302-php-simple-upload/#findComment-887832
Share on other sites

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.