I have a script which uploads files to my server... In the script I check to see if the file already exists before it uploads...
if(file_exists($checkFile))
If it does exist I echo out two forms... One is to overwrite the file
//$userfile is the location of file on users computer taken from the upload script
echo"<p>The file <font color=\"#CCCCCC\"><strong><i>$userfile_name</i></strong></font> already exists!</p>
<p>Would you like to overwrite this file? <br />
<FORM name=\"form1\" id=\"form1\" method=\"POST\" action=\"overwrite.php\">
<input type=\"hidden\" value=\"$userfile\" name=\"userfile\" />
<input type=\"hidden\" value=\"$userfile_name\" name=\"userfile_name\" />
<input type=\"hidden\" value=\"$userfile_size\" name=\"userfile_size\" />
<input type=\"hidden\" value=\"$userfile_type\" name=\"userfile_type\" />
<input type=\"hidden\" value=\"$archive_dir\" name=\"archive_dir\" />
<input type=\"submit\" name=\"submit\" value=\"Overwrite\" />
</FORM>";
The second gives the option to rename
echo"<p>Would yo like to rename this file? <br />
<FORM name=\"form2\" id=\"form2\" method=\"POST\" action=\"rename.php\">
<input type=\"hidden\" value=\"$userfile\" name=\"userfile\" />
<input type=\"hidden\" value=\"$userfile_size\" name=\"userfile_size\" />
<input type=\"hidden\" value=\"$userfile_type\" name=\"userfile_type\" />
<input type=\"hidden\" value=\"$archive_dir\" name=\"archive_dir\" />
<input type=\"text\" name=\"newName\" value=\"\" />
<input type=\"submit\" name=\"submit\" value=\"Change\" />
</FORM>
The forms call new scripts either rename.php or overwrite.php... All of the infomation is passed to the new script fine... I print it out to check.... but when I press teh overwrite or rename button it says it can not copy... Just wondering why it can't
The file upload script seems to hold the location of the file to be copied in a tempaory location ie... /tmp/php8OUdV1
Maybe that is lost when it goes to a new script....???
Any thoughts...