The following code always gives me a $userfile value that is local to the user's (WINNT) machine and not local to the server machine (Solaris).
When I run this, the resulting $userfile value is always something like "C:\blah\blah\blah.txt". I thought that the file would have been uploaded to the server machine and have a name like /var/tmp/php<something>. I set the evironment variable TEMPDIR to /var/tmp before restarting my Apache server.
Any help is greatly appreciated.
<head>
<title>Untitled</title>
</head>
<body>
<FORM ACTION="uploadregression.php" METHOD=POST ENCTYPE=multipart/form-data">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="10000">
Submit this file: <INPUT TYPE=FILE NAME="userfile"><BR>
<INPUT TYPE=SUBMIT><BR>
<?php
if($userfile != "" ) {
$dateStr = date('Y-m-d');
$targetFileName = $dateStr . ".html";
echo( "User File is $userfile\n");
echo( "User File Name is $userfile_name");
/
if (copy($userfile, "/usr/local/apache/htdocs/regression/$targetFileName")){
echo(" File Saved Successfully. ");
}
else {
echo (" Error, file cannot be saved.");
}
/
}
?>
</body>