I've got a form that has a file upload..here's the snippet of that code:

snip
<p>Image of Author:
<input type="hidden" name="MAX_FILE_SIZE"
value="51200">
<input type="file" name="image">
snip

Now when this form is "submitted" it gets sent to a confirmation page which displays the the form info fine:
Which it is displaying this info fine.
Snippet of that code:

snip
Image: <?php echo "<b>$image_name</b><br>\n"; ?>
snip

Now, if the user is ready to insert this into the database, they select the upload button. And I'm passing this $image variable as a hidden variable. See below:

snip

<form method="POST" action="insert_author.php"
enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="51200">
<input type="hidden" name="image" value="<?php echo $image ?>">

<input type="submit" name="submit" value="submit"> </form>

snip

The problem is, this file $image, is not moving along to the next page (insert_author.php)

Am I allowed to pass this file along from script to script? Or does it get lost somewhere? Any help on this matter would be appreciated.

    Hi
    I dont think you can use the image in the hidden field and pass it on to the next page. This is not an issue with PHP but is a part of the HTTP I believe.
    But we do have such a page on our sit, where we read the file upload it and if the client decides to throw away the image, we have a file pointer on the server end which helps us in handling the file (moving, deleting, or archiving).

    Hope this helps.

      Write a Reply...