I just cut and pste your code.
unfortunately, following error was give.
please help
Bhojemb.sql is the file name I am trying to upload.
You are really taking pains to help me.
I appreciate that.
action = upload
Archive_dir -==> /home2/prajaktasoftware/www/email/
archive_dir after adding file name -> /home2/prajaktasoftware/www/email/Bhojemb.sql
can't copy Bhojemb.sql to /Bhojemb.sql
The code is listed here as it is
<?
//file_upload.php
$archive_dir = "./txt";
function upload_form()
{
global $PHP_SELF;
?>
<form method="post" enctype="multipart/form-data" action="<? echo $PHP_SELF ?>" >
<input type="hidden" name="action" value="upload">
<input type="file" name="userfile" ><br>
<input type="submit" name="submit" value="Upload"><br>
</form>
<?
}
function upload_file()
{
global $userfile, $userfile_name, $userfile_size,
$userfile_type, $archive_dir, $WINDIR;
if (isset($WINDIR))
$userfile = str_replace("\\","\", $userfile);
$archive_dir="/home2/prajaktasoftware/www/email/";
print "Archive_dir -==> $archive_dir";
$filename=basename($userfile_name);
if ($userfile_size <= 0) die ("$filename is empty !!");
$archive_dir.=$filename;
print "<br>archive_dir after adding file name -> $archive_dir<br>";
if (!@copy($userfile, $archive_dir))
die ("can't copy $userfile_name to $archivedir/$filename");
// if (isset(!$WINDIR) && !@unlink($userfile))
// die ("Can't delete the file $userfile_name");
echo "$filename has been successfully uploaded <br>";
echo "File Size :". number_format($user_size)."<br>" ;
echo "FileType:$userfile_type<BR>";
}
?>
<html>
<head><TITLE>FILE UPLOAD</TITLE></head>
<BODY>
<?
if($action == "upload")
{
print "action = $action<br>";
upload_file();
}
else
{
upload_form();
}
?>
</BODY>
</html>