I have a problem uploading files from the form every time I try, I do not have "file type permission" error Meets. I am using the HMVC modular extension and extend my controller MX_Controller.
I have already tried $ var_dump ($ _ FILES) from my form-view and the result is fine, but when I try to use method do_upload () in the controller Does not work
Do anyone have any ideas? Here is the controller:
class stores_data MX_Controller Expands
{
function __construct () {origin: __Creating (); } Upload_pic () {// $ data ['item_id'] = $ item_id; $ Template = "bootstrap_theme"; // $ current_url = current_url (); // $ data ['form_location'] = $ current_url; $ Data ['view_file'] = "upload_pic"; $ This- & gt; Load-> Module ('template'); $ This- & gt; Templates & gt; $ Template ($ data); } Function do_upload () {// var_dump ($ _ files); $ Config ['upload_path'] = './images/'; $ Config ['allowed_types'] =' GIF | JPG | PNG '; $ Config ['max_size'] = '10000'; $ Config ['max_width'] = '4024'; $ Config ['max_height'] = '4768'; $ This- & gt; Load-> Library ('upload', $ config); $ This- & gt; Upload-> Overwrite = true; $ This- & gt; Upload-> Start ($ config); If (! $ This-> upload-> do_upload ()) {$ data ['error'] = $ this-> Upload-> Display_rors (); $ Template = "bootstrap_theme"; $ Data ['view_file'] = "upload_pic"; $ This- & gt; Load-> Module ('template'); $ This- & gt; Templates & gt; $ Template ($ data); } And {$ data ['upload_data'] = $ this- & gt; Upload-> Data (); $ Template = "bootstrap_theme"; $ Data ['view_file'] = "upload_success"; $ This- & gt; Load-> Module ('template'); $ This- & gt; Templates & gt; $ Template ($ data); }}
And here is the upload form view:
& Lt; Br / & gt; & Lt; Br / & gt; & Lt; Input type = "submit" value = "upload" / & gt; & Lt; / Form & gt;
I solved the problem in php.ini extension = php_fileinfo.dll and comments; Extension = php_mime_magic.dll
thanks anyway
div>
Comments
Post a Comment