OK I am having diffuclty uploading files from client to server
***************Here is my form
<form enctype="multipart/form-data" action="<?=$PHP_SELF?>?session_id=<?=$session_id?>&action=<?=$action?>" method="post">
<input type="hidden" name=MAX_FILE_SIZE value=100000000>
<input type="File" name="userfile" size="30" maxlength="255" accept="image/jpeg, image/pjpeg">
<input type="hidden" name="newname" size="30" maxlength="255" value="<?echo $file_id ?>">
Here is my function
function do_upload($filename,$newname)
{
global $file;
global $tmp_upload_path;
global $new_file_name;
global $user_file;
global $new_name;
$file = basename($filename);
$tmp_upload_path = "server temp directory path";
$new_file_name = "server directoty/folder/path/newame.jpg";
if (!copy($tmp_upload_path.$file, $new_file_name)) echo "failed to copy file<br>\n";
return;
}
I have used this function for intranet applications without any problems, however now I am recieving errors
*************Error
Can't open file for reading
Maybe someone hase a better function I could try?
Please dont respond with something like READ THE MANUAL,I have done that. I would appreciate some real assistance from someone that knows something about file uplaods
Thanks in advance