Uploading a file |
[eluser]Unknown[/eluser]
Hi Everyone, Could you please help me with this? I'm using the file uploading class to upload a file: http://ellislab.com/codeigniter/user-gui...ading.html However, it tries to upload a file even if I don't actually choose anything. This is particularly annoying when I'm trying to update a form which has the option to update an image. If I'm using the following input in my form, <input type="file" name="userfile" size="20" /> How do I check if a file has actually been chosen or not? I've tried the following statement and it does not work. $filename = $this->input->post('userfile');
[eluser]eoinmcg[/eluser]
Hi, Uploads are stored in $_FILES rather $_POST, hence not showing up in $this->input->post('fieldname') Try Code: if($_FILES) There may be a better way of doing it, though this works for me...
[eluser]spagi[/eluser]
Code: if (isset($_FILES['userfile'])) |
Welcome Guest, Not a member yet? Register Sign In |