File upload not working (no errors even displayed) |
[eluser]bhakti.thakkar[/eluser]
hi all, i am trying to upload file but it isnt working. below in the code in MVC: view.php Code: <?php echo form_open_multipart('ncs/do_upload/' . $row->NonConformity_ID, array('id'=>'private_note_form'));?> Code in the controller: ncs.php: Code: function do_upload($id) No error messages also displayed. files also not uplaoded in the specified path. just a blank page. i have checked the directory access also (CHMOD = 777) Please help me Thanks
[eluser]bhakti.thakkar[/eluser]
At last i found the problem: i had not specified the allowed type extension as i wanted the user to upload of any file type: just added this all and things started working $config['allowed_types'] = 'gif|jpg|png|pdf|txt|doc|docx|xls|ppt|jpeg'; Hope it helps some newbie Thanks
[eluser]xwero[/eluser]
Good you found it on your own, welcome to the CI world!
[eluser]HrvojeKC[/eluser]
I had the same problem an the fix was to ad these lines into the mimes.php inside the config folder. Code: 'doc' => 'application/msword', and inside my controller changed the $config['allowed_types'] to 'word|xls|xlsx|pdf|zip'; before it was 'doc|docx|xls|xlsx|pdf|zip';
[eluser]sereyous[/eluser]
I'm having the same issue however setting $config['allowed_types'] did not help. I am autoloading the upload library and my upload folders are all set to 777. When I submit the form nothing happens - just a blank white page. Here's my code: Code: ========== This has been driving me nuts. Thanks in advance for any insight.
[eluser]danmontgomery[/eluser]
white page = php error, check apache error log
[eluser]HrvojeKC[/eluser]
hi sereyous, blank white screen points to an php error. Try to enable the display of php errors or to enable them to be logged into a log file so you can track the errors.
[eluser]sereyous[/eluser]
Thanks for the helping out a noob. @noctrum I did tailf error_log in putty session and attempted an upload - nothing reported. @HrvojeKC error_reporting(E_ALL) in index.php. Is this not enough to have PHP display errors? What else do I need to do? Thanks again.
[eluser]HrvojeKC[/eluser]
Maybe this page will help http://www.php.net/manual/en/errorfunc.c...ration.php or simply try Code: ini_set('display_errors',1);
[eluser]sereyous[/eluser]
Fixed! I had added a mime type for wmv files in mimes.php and failed to put a comma after the preceding entry. Why CI did not produce any errors is beyond me, but at any rate, thanks for the help! |
Welcome Guest, Not a member yet? Register Sign In |