Welcome Guest, Not a member yet? Register   Sign In
$_FILES array full while CI upload class empty
#1

[eluser]navotjer[/eluser]
Hey!

So I ran into a tricky thing today, while we were developing an upload service.
The service receives file uploads a via sockets - php to be exact and the result is, the $_FILE array is working as expected (the file is normally uploaded), the file is recognized, while the CI upload class thinks there has been no upload done.

So, any ideas of where we've gone wrong?

We're going to continue using $_FILES, but it would be easier to use CI class as it has already built-in security mechanisms.

Thanks for all of your tips and thoughts.
#2

[eluser]CroNiX[/eluser]
Code:
<input type="file" name="userfile" size="20" />

If the file input name is anything OTHER than "userfile", you must pass the field name to the upload function, like
Code:
$this->upload->do_upload('name-of-file-field')

Have you changed the input name and if so are you doing it this way? Hard to tell with no code posted. It could be a lot of things...
#3

[eluser]navotjer[/eluser]
Smile I love u!

Thank you, the one thing I've overlooked (mainly because with sockets, you manually set headers, and kinda forgot about that).

Works like a charm!

Best regards, Jernej




Theme © iAndrew 2016 - Forum software by © MyBB