![]() |
Standard File Uploading Error - 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: Standard File Uploading Error (/showthread.php?tid=33939) |
Standard File Uploading Error - El Forum - 09-13-2010 [eluser]kane.zach[/eluser] Hey all, I'm going insane at the moment trying to figure this incredibly low level problem. I've been messing with image uploading elsewhere and things are going smoothly. Now, just to start out on a new project, I've got up the basic CI File Upload views and controller, precisely from the User Guide (except for the max_size var so I don't have to look for tiny files during testing). I have an uploads dir in my public html set to 777. I've checked my php.ini and file_uploads is ON, max_file_uploads is 20 and upload_max_filesize is 2M. None of the files I'm testing with are close to that size. upload_tmp_dir has no value (if this means something with respect to this?) Once I submit I just get back the upload_form with the error 'you did not select a file to upload', obviously following the controller's control statement. Does anybody have anything else I can check or alter? It's late so maybe I left something out but at the moment I'm stumped and it's infuriating! Standard File Uploading Error - El Forum - 09-14-2010 [eluser]kkristo[/eluser] Hope you are don't submit form via ajax/jquery. Jquery can't upload image. Then check from form what correct Image name are: <input type=file name="TestImage"> and controller $this->upload->do_upload('TestImage') Standard File Uploading Error - El Forum - 09-14-2010 [eluser]kane.zach[/eluser] Oh no, of course I'm not messing with jQuery or anything like that now. I seriously have only the 2 Views and 1 Controller from the User Guide. I changed the input's name to something else beside 'userfile' making sure to add that to do_upload()'s params and still nothing. ...I just double checked my php config. register_globals is set to off. my other host has that set to on by default. I know CI 'disables' the GET var but I'm assuming that the Upload lib probably accesses $_FILES no? How else would that be accessed? Standard File Uploading Error - El Forum - 09-14-2010 [eluser]kkristo[/eluser] OK.. before do_upload('MuFile') try print_r($_FILES); If you don't see variables, then server have disabled file upload. Standard File Uploading Error - El Forum - 09-14-2010 [eluser]kane.zach[/eluser] Well, i put that at the top of my form and i get "Array ( )" Standard File Uploading Error - El Forum - 09-14-2010 [eluser]kkristo[/eluser] After form submit $_FILES can't be empty. I think you have some typo html. Standard File Uploading Error - El Forum - 09-15-2010 [eluser]LuckyFella73[/eluser] Did you set up a multipart-form? Would be helpfull if you show the form-script and the controller script handling the form data. Makes it much easier to help. Standard File Uploading Error - El Forum - 09-15-2010 [eluser]kane.zach[/eluser] Okay, this is all that is going on: Controller Code: <?php Initial View Code: <html> Success View Code: <html> Standard File Uploading Error - El Forum - 09-15-2010 [eluser]LuckyFella73[/eluser] Hej kane.zach, I did set up a fresh CI installation and copied and pasted your code. No error - everything works like expected. So the error must be anywhere else... Standard File Uploading Error - El Forum - 09-22-2010 [eluser]kane.zach[/eluser] Well, it's solved? I'm working on this on a host a friend setup which had a lot of strange dirs and files for proprietary stuff. I saved all those locally, burned the entire public_html directory to the ground (hah), and re-downloaded the latest CI. Setup, added my controller & views back and things are cool...? I suppose I shouldn't complain. Machine mysticism. |