HormonX
10-24-2002, 02:47 AM
As usuall i need some help :) .. this tim eit's file uploading ... i have a simple script and it works great when i use it on a single page .. i mean that if i use the form and file upload process on the same page it works great ... but i have a form on one page .. and then the form is being submited on the other page and that where the file is being uploaded. Anyhow it should be uploaded.
Am assuming it has something to do with the full path of the file.
here is ther script ...
<?php
$path = "/upd/";
$max_size = 200000;
if (is_uploaded_file($userfile)) {
if ($userfile_size>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($userfile_type=="image/gif") || ($userfile_type=="image/pjpeg")) {
if (file_exists($path . $userfile_name)) { echo "The file already exists<br>\n"; exit; }
$res = copy($userfile, $path . $userfile_name);
if (!$res) {
echo "upload failed!<br>\n"; exit; }
else
echo "upload sucessful<br>\n";
echo "File Name: $userfile_name<br>\n";
echo "File Size: $userfile_size bytes<br>\n";
echo "File Type: $userfile_type<br>\n";
} else { echo "Wrong file type<br>\n"; exit; }
}
?>
and the error i get while trying to upload on the other page .. is
Warning: Unable to create 'master.gif': Permission denied in /home/mydomain/public_html/ver_form.php on line 152
upload failed!
The directory is there .. i even gave the folder full permition just to see .. and it's still the same thing.
Please help ...
HormonX
Am assuming it has something to do with the full path of the file.
here is ther script ...
<?php
$path = "/upd/";
$max_size = 200000;
if (is_uploaded_file($userfile)) {
if ($userfile_size>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($userfile_type=="image/gif") || ($userfile_type=="image/pjpeg")) {
if (file_exists($path . $userfile_name)) { echo "The file already exists<br>\n"; exit; }
$res = copy($userfile, $path . $userfile_name);
if (!$res) {
echo "upload failed!<br>\n"; exit; }
else
echo "upload sucessful<br>\n";
echo "File Name: $userfile_name<br>\n";
echo "File Size: $userfile_size bytes<br>\n";
echo "File Type: $userfile_type<br>\n";
} else { echo "Wrong file type<br>\n"; exit; }
}
?>
and the error i get while trying to upload on the other page .. is
Warning: Unable to create 'master.gif': Permission denied in /home/mydomain/public_html/ver_form.php on line 152
upload failed!
The directory is there .. i even gave the folder full permition just to see .. and it's still the same thing.
Please help ...
HormonX