![]() |
Upload File Problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Upload File Problem (/showthread.php?tid=40676) |
Upload File Problem - El Forum - 04-15-2011 [eluser]codeign00b[/eluser] Hi codeignitr experts. I need help with uploading files with codeigniter. My problem is that I can't upload anything, everytime I get You did not select a file to upload. Here is the function in my controller: Code: function upload() I have note that I have server settings like this: /home | + app | + application | + system | + files | + scripts | + index.php index.php is symlinked to www folder View file (form): <?php Code: ... Please help me with. Than you all! p.s. ignore error pages, they are set to view the errors when developing. Upload File Problem - El Forum - 04-15-2011 [eluser]codeign00b[/eluser] Anyone? Upload File Problem - El Forum - 04-15-2011 [eluser]fesweb[/eluser] i didn't read your code line-for-line, but you are not telling the library what file field you want to upload... So, in your case: Code: $this->upload->do_upload('filename'); Upload File Problem - El Forum - 04-15-2011 [eluser]codeign00b[/eluser] I've changed like you said, but I'm getting the same error: You did not select a file to upload. Do I have the wrong path? Upload File Problem - El Forum - 04-15-2011 [eluser]fesweb[/eluser] It's always worth looking at the path you are trying to write to. Echo it to make sure that it is what you think it is, and then check permissions to make sure that Apache/PHP can write to that directory. Also, double check your actual form's file field and your do_upload('your_file_field_name') to make sure that those two field names are in agreement. Upload File Problem - El Forum - 04-15-2011 [eluser]codeign00b[/eluser] Folder permissions are at 777 of course. Echo gives me /var/www/admin/files I have the folder there called files. So it's not the path. Any other ideas why this doesnt work? p.s. they match. id and name of the upload field is file and I have do_upload('file'). p.s.s. Now I'm getting this error: The upload destination folder does not appear to be writable. although the folder permisions are st to 777, so it's writable as it can be. Upload File Problem - El Forum - 04-15-2011 [eluser]LuckyFella73[/eluser] I didn't test this but you could try Code: // in the validation part of your code: Hope that helps Upload File Problem - El Forum - 04-16-2011 [eluser]codeign00b[/eluser] Thank you! Now everything works like a charm. Thank you all for your help. |