Why cant i check for $_FILES without element
Hi i been fighting this deal to figure out why its not posting with no file upload and i just found that if i do
This works fine
Just fyi im checking if no file upload then do a dif process.
update is it that if you have it turned on then $_FILES always exists no matter what its just the name that is blank?
Not sure what you mean by "turned on", but $_FILES will always exist so long as you have an input type of file (and have a enc type of multipart/form-data of course).
By providing it with no file, than you can still find an offset in $_FILES under your input name. Since the very first thing you should do with the upload is determine if it was successful, you can check the $_FILES['value']['error']. Failing to fill select a file will result in an error code of UPLOAD_ERR_NO_FILE (the integer value of 4).
So to check no file in particular, you would use:
You can find all the error codes for uploads here: http://php.ca/manual/en/features.file-upload.errors.php
Thanks sorry, yeah by turned on i meant having this in my form - multipart/form-data
:) learn something new every day, i never knew it was there regardless, makes me think i should go back and check some of my older coding now.... it never ends lmao hee hee
|All times are GMT +1. The time now is 03:53 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.