Jump to content

uploaded file missing filename


rubing

Recommended Posts

I must be overlooking something very simple here.  On my html page I am letting the user select a file to upload.  This file is submitted to my php script, where its temporary filename is assigned to a variable:

 

$lines = file($_FILES['uploaded_file']['tmp_name']);

 

This page shows the user what his submission looks like.  If the user approves of the submission they click the submit button as follows:

 

<form action="band_ins2.php" method="post">
echo "<input type='hidden' name='bands' value='$lines' />";
<input type="submit" value="Approve" />
</form>

 

Unfortunately, the submitted value of $lines is coming up as Array, rather than the filename.

Link to comment
https://forums.phpfreaks.com/topic/106401-uploaded-file-missing-filename/
Share on other sites

The temporary uploaded file and the $_FILES array are destroyed when the first form processing code ends. You cannot goto yet another form processing page unless you save the uploaded file and the $_FILES array somewhere, like in a session.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.