Posted by Michael Rassinger on 03/14/07 20:50
Hi!
I am facing the following problem:
I have a PHP-script on page A that receives a file from an HTML-form. I
need to immediately forward this file to another page B.
On page A currently I forward the user (under certain circumstances) to
page B using
header ("location: page_b.php");
But unfortunately the file that was posted to page A is lost. Is there a
way to forward the file to page B so that I can use the superglobal
$_FILES variable on page B?
I tried a very bad hack with sessions:
On page A:
$_SESSION["files"] = $_FILES;
On page B:
$_FILES = $_SESSION["files"];
I didn't really expect this to work - unfortunately it does not because
the server deletes the temporary file immediately. Well, I could try
copying the temporary file to a different filename but I believe there
is a simpler way by just adding the file again to the header?
Any suggestions on this? Thanks in advance!
Mike
Navigation:
[Reply to this message]
|