Welcome Guest, Not a member yet? Register   Sign In
How to check if file upload form is set
#1

[eluser]Unknown[/eluser]
hello, I would like to ask you, how can I check if in file upload form is set any path to file.

I would take some condition depending on file upload form state but BEFORE! I use $this->upload->do_upload()
#2

[eluser]Mark van der Walle[/eluser]
Note this assumes: <input type="file" name="myfile" />
Code:
if (isset($_FILES['myfile'])) {
    // do your thing here
}
Note that this does not check for valid upload etc.
#3

[eluser]xwero[/eluser]
Code:
if ($_FILES['myfile']['error'] != 4) {
    // do your thing here
}
If you want to check if a file is selected.
#4

[eluser]Unknown[/eluser]
thx! works great!




Theme © iAndrew 2016 - Forum software by © MyBB