If I do something like this to get handle file uploads:
if ($_FILES) {
foreach ($_FILES as $file) {
//...Handle the upload process
}
}
Is there any way that I can get the key of the file? As in:
<input type="file" name="myfile" />
I want to know that the file is coming from "myfile".
Edit: The obvious solution to this turns out to be:
foreach($_FILES as $key => $file) {
$input_name = $key;
// Handle upload.
}