Ask a Question related to PHP Development, Design and Development.
-
Martijn Wijma #1
Upload Files with Safe Mode error
Hello everybody.
I get the following error when i try to upload a image
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 573 is not allowed to access
/home/virtual/site71/fst/var/www/html/images/fotos/Test owned by uid 48
in /home/virtual/site71/fst/var/www/html/admin/upload.php on line 55
It seems that the default tmp directory falls outside my account.
I already contacted the host but they won't change anything because of
security reasons.
Does anybody have an idea how I can make this work?
----------------Source Code ------------------------------------
<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="img" size="50" class="upload" lang="nl" />
<input type="submit" name="submit" value="Uploaden" />
</form>
==Upload.php==
$naam = $_FILES['img']['name'];
$type = $_FILES['img']['type'];
$size = $_FILES['img']['size'];
$map1 = $_POST['catogerie'];
for ($t=0; $t<strlen($map1); $t++) {
if (eregi("[a-z0-9]", $map1[$t])) {
@$map .= $map1[$t];
}
}
$cat=$_POST['catogerie'];
$file = '../images/fotos/'.$map.'/'.$naam;
move_uploaded_file($_FILES['img']['tmp_name'], $file);
//thumbnail maken
$w = "100px";
$h = "75px";
$naam = $_FILES['img']['name'];
//Blanco image aanmaken
$thumb = imagecreatetruecolor ($w, $h);
$image = ImageCreateFromJpeg($img);
$imagedata = getimagesize($img);
imagecopyresampled ($thumb, $image, 0, 0, 0, 0, $w, $h,
$imagedata[0],$imagedata[1]);
imagejpeg($thumb, $img);
//thumbnail wegschrijven
$thumb = '../images/thumb/'.$map.'/'.$naam.'';
move_uploaded_file($img, $thumb );
--------------------------------------------------------------
Martijn Wijma Guest
-
#25411 [Com]: Change SAFE MODE behavior for new dirs or files
ID: 25411 Comment by: roman at compic dot ee Reported By: 4u at direct-netware dot de Status: Open Bug Type: ... -
#25411 [NEW]: Change SAFE MODE behavior for new dirs or files
From: 4u at direct-netware dot de Operating system: Linux in general PHP version: Irrelevant PHP Bug Type: Feature/Change... -
What exactly is safe mode?
Hello, Can someone point me to somewhere that explains what safe mode is and why it's good to have it on or off? Tried to get an explanation on... -
[PHP] How can I clean uploaded files from /tmp in safe mode?
> Uploaded files should automatically be purged when script ends. What are you Ahhhh...thank you....I didn't realize they were deleted when the... -
How can I clean uploaded files from /tmp in safe mode?
I am running a script which accepts uploaded files in safe mode. Is there a way to get rid of all files stored in /tmp using PHP or do I need to...



Reply With Quote

