You are here: POST $_FILES « PHP Programming Language « IT news, forums, messages
POST $_FILES

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация