How can I manipulate the $FILES array when uploading via an HTML form to get the filename info? I'm trying
$path = $_FILES['UploadFile']['name'];
but obviously that's not correct.
a handy way to view a whole array or an object is print_r().
so, if you do...
print_r($_FILES);
you can see all the properties. its my favourite function during development 🙂
dougal85 wrote:a handy way to view a whole array or an object is print_r(). so, if you do... print_r($_FILES); you can see all the properties. its my favourite function during development 🙂
Strange, it's coming up as a blank array
Ok, forget it, for some reason the $FILES array isn't working at all. However, I found that I could use $POST['file] to get what I need. Thanks for that function though, I think it will be fairly helpful later on.
make sure you have this in the form tag;
<form name="name" action="target.php" method="post" enctype="multipart/form-data">
you need that enctype for files to be sent 😉
Haha, well that might have been the problem. Thanks!