File Upload Problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: File Upload Problem (/showthread.php?tid=11205) |
File Upload Problem - El Forum - 08-30-2008 [eluser]prezet[/eluser] Hi, I've got a small problem where I can't seem to use the Upload class properly. I've generated a multipart form with the form helper as required for file uploads as follows: Code: <?= Here is my controller code to handle the file upload: Code: // Load upload class Basically, nothing is being returned from the data method. The standard PHP $_FILES array shows the file and it's temporary path etc as it should, but the data() method returns a blank array like this: Code: Array ( [file_name] => [file_type] => [file_path] => /myuploads/ [full_path] => /myuploads/ [raw_name] => [orig_name] => [file_ext] => [file_size] => [is_image] => [image_width] => [image_height] => [image_type] => [image_size_str] => ) With an error message of 'You did not select a file to upload.' So am I doing something wrong? Thanks File Upload Problem - El Forum - 08-30-2008 [eluser]Colin Williams[/eluser] Either rename you upload field to 'userfile' or change the call to do_upload() so it passes the correct field. Code: // Perform upload File Upload Problem - El Forum - 08-30-2008 [eluser]prezet[/eluser] Thank you. In my haste to read the documentation I obviously missed that tiny detail. |