Crazydog
08-01-2007, 10:55 PM
I have a file upload field in my form.
I have two questions relating to it.
1) How would I validate it to make sure some type of file was chosen (type doesn't matter, just that the box wasn't empty)
(I tried: if((empty($_FILES["thumb"]))){ but that didn't work)
and
2) How do I get the value of what was put in the field (the file path), so that it can be re-inserted into the file field via php?
Edit:
Got answer to first: I needed $_FILES['thumb']['name'];
Second question: I read that value field doesn't work in file uploads...I can live w/o it, but if there is a way, I'd like to know
I have two questions relating to it.
1) How would I validate it to make sure some type of file was chosen (type doesn't matter, just that the box wasn't empty)
(I tried: if((empty($_FILES["thumb"]))){ but that didn't work)
and
2) How do I get the value of what was put in the field (the file path), so that it can be re-inserted into the file field via php?
Edit:
Got answer to first: I needed $_FILES['thumb']['name'];
Second question: I read that value field doesn't work in file uploads...I can live w/o it, but if there is a way, I'd like to know