I used
import_request_variables("P", "$submit");
to import all the data from the form so I can use them as a plain variables...
Well, I have to say next step confused me. The variable that hold the data from the upload file field of the form is never empty but instead is an Array (!)...:queasy:
Lets say the upload file field is named file. So, the Array $file will hold values in following keys: name, type, tmp_name, error and size... They are pretty much self explanatory so I won't bother explaining them additionally.
The values of the Array elements are never the same and they go like this:
When the uploaded file filed is empty (i.e. nothing offered for upload) the values are:
name ""
type ""
tmp_name ""
error 4
size 0
If the file offered for upload is something meaningful the values are:
name /name of the file/
type - mime type of the file i.e. image/jpeg for jpeg image file, application/msword for word document file...
tmp_name /whatever name was givven to the file in temp folder/
error 0 /this means that something was offered for upload/
size /the size of the file in bytes offered for upload/
If the file offered for upload is .exe, .fla or .zip (well, at least I tested these) or the file is too big (bigger than the max_file_upload form field), the values are:
type /name of the file/
tmp_name ""
error 2 (or 1 - I didn't catch when is which)
size 0
This way I could determine whether the file was too big or was of the wrong type...:p
Maybe I am stupid but I tried the same with $_FILES['file'] (if you don't import variables ycan use this way) stuff, but I missed the concept that this array is never empty...:rolleyes:
Hope you find this usefull...