⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Grocery_Crud_Multiuploader library



Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 22 December 2014 - 15:20 PM

Hi ! Guys

 

This is my first post on this forum, I wrote small library which extends existing grocery_crud library this made my work easy so  I just wanted to share with you guys, you can also make use of it.

 

Please use below link to use the same

 

https://github.com/Akshay-Hegde/grocery_crud_multiuploader

 

https://codeload.github.com/Akshay-Hegde/grocery_crud_multiuploader/zip/master

 

Thank you all.


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 22 December 2014 - 16:16 PM

Nice effort - Akshay - i appriciate it..!!


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 22 December 2014 - 21:27 PM

Nice effort - Akshay - i appriciate it..!!

 

 

 

Thank you


Peter

Peter
  • profile picture
  • Member

Posted 24 December 2014 - 04:39 AM

Thanks for sharing code, and nice instructions on github, happy to inform you that its working for me :)


Alan Fernandes

Alan Fernandes
  • profile picture
  • Member

Posted 13 January 2015 - 23:55 PM

thanks for shared!!! :D


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 11 March 2015 - 11:44 AM

thanks for shared!!! :D

 

You are welcome.


Ador El

Ador El
  • profile picture
  • Member

Posted 27 May 2015 - 18:27 PM

Using PHP 5.3 causes this error when using the library

 

Parse error: syntax error, unexpected '[' in D:\Hosting\2543486\html\ci\application\libraries\Grocery_CRUD_Multiuploader.php on line 118

 

 

I have changed lines like:

if( $has_callbacks && isset($this->callback_column[$field_name]) )
                    $list[$num_row]->$field_name = call_user_func($this->callback_column[$field_name], $field_value, $row,$this->get_field_types()[$column->field_name]);
               

by

if( $has_callbacks && isset($this->callback_column[$field_name]) )
{
     $aux = $this->get_field_types();
     $param = $aux[$column->field_name];
     $list[$num_row]->$field_name =     call_user_func($this->callback_column[$field_name], $field_value, $row,  $param);
} 

and

$files_exists = unserialize($this->ci->db->get_where(
                        $this->file_table,array(
                        $this->primary_key => $primary_key
         ))->result_array()[0][$this->upload_field]);

by

$f1 = $this->ci->db->get_where(    $this->file_table,array( $this->primary_key => $primary_key ))->result_array();
$f2 = $f1[0];
$files_exists = unserialize($f2[$this->upload_field]);

I realized it was array dereference  issue, so thats why I have changed several lines of attached library file.

 

However When clicking upload button and file is uploaded firebug says

null

D:/Hosting/ci/index.php?/multiuploader/index/add(line 110)
TypeError: data.result is null

if(data.result.success == 'false') {

what is the reason I get null when uploading?

 

 

Post parameters are

new_multi_upload/uploade

Headers

Accept application/json, text/javascript, */*; q=0.01 Accept-Encoding gzip, deflate Accept-Language es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3 Content-Length 300832 Content-Type multipart/form-data; boundary=---------------------------22444249596590 Cookie __utma=19637472.628213608.1344575154.1428156381.1430166708.42; __utmz=19637472.1410633020.21.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); crud_page_9c3b069b19e71f5f75b588a6ccab36fe=1; per_page_9c3b069b19e71f5f75b588a6ccab36fe=10; hidden_ordering_9c3b069b19e71f5f75b588a6ccab36fe=; hidden_sorting_9c3b069b19e71f5f75b588a6ccab36fe=; search_text_9c3b069b19e71f5f75b588a6ccab36fe=; search_field_9c3b069b19e71f5f75b588a6ccab36fe=; ci_session=a%3A4%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22c83aeac3304adafff9ee31fa18a0bb3b%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A15%3A%22187.232.159.164%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A65%3A%22Mozilla%2F5.0+%28Windows+NT+6.1%3B+rv%3A38.0%29+Gecko%2F20100101+Firefox%2F38.0%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A14327718

44%3B%7D0bc3c9f5614df84019216391cbd0bbce77f534d0 Host inametco.com Referer D:/Hosting/ci/index.php?/multiuploader/index/add User-Agent Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0 X-Requested-With XMLHttpRequest

Post

-----------------------------22444249596590 Content-Disposition: form-data; name="ci_csrf_token" -----------------------------22444249596590 Content-Disposition: form-data; name="field" my_pictures -----------------------------22444249596590 Content-Disposition: form-data; name="my_pictures_new_multi_upload"; filename="mi.jpg" Content-Type: image/jpeg ÿØÿàJFIF``ÿáÀExifMM*1.V2„‡i˜êJêMicrosoft Windows Photo Viewer 6.1.7600.163852015:05:26 18:57:47êªêÿá1¸http://ns.adobe.com/xap/1.0/<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> <x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:xmp="http://ns.adobe.com/xap/1.0/"><xmp:CreatorTool>Microsoft Windows Photo Viewer 6.1.7600.16385</xmp:CreatorTool></rdf:Description></rd ... Los datos de la solicitud superan el tamaño límite de Firebug. ... 5Ùh·ì¼ÖUƒðE¶FûÄw®Ü6u´FnV9ý7ÃÚ–¨vZñґ…ÚÏjî´¿èºj)‰f>cöú ÛŽaEŽ$ Å 0túú }*kÞWd96pž#ðÜŽ÷º @ùÐg=Êœu®BÙbim®Ë¨ßa:ýkÚ«™ñíµXå¹³ þ2p$#¦êù.!àêX¨J® )TnítäÿÓÀæ.”’ªïƒ†ñ/ –%ù%Só!ôëoÚÛÌÖ÷¿(l$*zqÖ³þè)h¦üNѹ¸fCÏ=ë'ÄšEþ²–ëiò]ŹT íõ<WåÔðMWöU4iÙúŸI9BPºÕnvØ?Ã’-p' ‘éÅnÙë×òÀ‹tÞc†Ú8â¸í'VÕ´Øáµ¾…Râ<#n˜æº]>k{Ù$I]”¹¥ËˆÃÞŒ&וôgtªGÅ¡Jèf«ÒÛlËÎOa]žË¼ìÆ=EsºÌP¬þ\ mÚ7mõ­ß9xÕ2U”øUdñœ³Zt›ÕÊÝ=:é±ÍŠŠXe(‘‹ËyÄ’Û|©Š6;•8#?ZÐC–VP9ÃŽMfÛ'•w«£D-ë° }ðÀÕø&YcWQ€Üק…Š£Œ©J/DÚûŸ–‡ Ex¦WÔšöâ­m”'F=d¨«“3ª‚uÂ¥Xä''Å w@¨{ñ“’Ôåhd``H€Ã­X\sÖ—ì¬T¿)éHИÏLõ®·B­(óJ.ÂVØ­<ÞJíØHa屔,å¸ÁòËHõÐ2+¯T…–¤š„—åM‹@Š°å’Þ±äwºØmȇx¦hÓç@FP=«‚¿²’n'*ëÙµ‹%’Vh¸À«†Ö|;çâM§åSÀ8ÃŽzq_E•çͪ5žûÀ=\;’Ôç·sÏ䉌ÑËò½ßéPMÛ„¤pÀœw­[‹d¶b¦5^F=êÌ,#v‡ûÙ ké=ÝÕÑ™,¬Å˜¶ÿv yYÔ…‰Uð>¹«#Ey0ÇH¨ÔDc¨ùÐä†Í&Ìå˜I€Ei>ef$¬F¬¦iJ Å¾NsެʖÎT‡çiè­U¥µÂ´±í=½é¦™›€Ìœá›8€Tf eÝòïÜ9ô¥3‡;çnŽ1Å¡p1|±|ü)ÛÓ#=‰¢H,T˜ËDd%䒿TèÒti6Ñ»hõ¤±‰SäzY"mÌøÊl,GB~ŸJÌ™¼—h›c€Ù>£Ò™öyº³db8ã•*æGÐÓ¼¦ˆ€ M29nWh‡”€¦TsèjÕ‡îó’A©eŽVʸÎG£xâTÂpÙ#®QZ§q´1Ïî|ª™=}E 2¿ÌªåõÅ8Û)`VU8ÇSíQÊê$|ƒ€G¨õ¡£&„m¥Èp8ÉíNÅ’DpG.£9õ¤hQ²Y° ç 8"„6{ …Á+ŒŽ)‰!ý$]í»Ó¡4ׇ-$ÊÃvá‚=1J<¹\3Ã¥A’1Ò’å˜@#…2ÛväzQrÃ’ `²DÄðwƒÐŠ­(-¼;ghê½…\òX”^ qÏ¥"£( ;‰É=¾´\Ñ$fÆ#,¡‰es‘RÆÀmÇ=;TÍGª¼¥Xt-ß4õr…^ùÆ*$‰<µ`;FY—ž´ª$pÍ!HÇCK7–0X|Ä*~CP6°Æ=1ïN2"Õ0à¦A®4ÈÂ…fB0ÇîžÕoÃ¥(̤I!{Ô/£|ê2‚vöúÖªEŸ*£SoUÃ…8m•ÃÌÅʨ /TyÁÚFrj`–Ed)‘A¦iîiE¹hÜ«QÕ€=Á¥GÆ `òR‘Ô<„ºåäŒuo®)@"ü£`¨ô?J‰FÆ—°÷T…ã;Ž[ޠ–|¸ pX`秵9ÐßiÚVSϛ8¦±€PÅ rj,>k‰ X8 >Üþ¢”¦Ž›OZžvaàÜžÞµhËœd½ˆ˜qZ›Ìó¶çtÊóÉõí].âù¬ ÛÝ–Ú#\°í“øô¬rS$cpÉ'’G§µVº/"ÄûFOB:‘Xbp´qå©þ.Æ3¦¥¹ì^$Šê D›ñƒZéuɆ|±ž¸¯±ÕnlÈQÐôýk¼±ñ?򼻋$ñ“Jüû8áÚ´$êRÖ—©çU£(¿#¼…üÑœŒ·ù$Ƀ³ÛéXÖúµœ‰ÏÎÖ,ÉÐb®­ä;]\‘êAµò΋D¨“îd‰³†!ÒãÁY7øâ«Ivã.`‘“R-P/9^@ê3K‘¡Øs@Fó»’ÇúûÔq£Ì„ŒçWÓêiÊä.³óôÇ¥F›Kn‹.ÐHÏz,ÄØù,Pc Ðñ5UèÌÄîæ¦òb”leùÎHç“BBé…$Æ:z÷úÖÑ2bʳs·w tàIm ö¥òÊ:™•%†Õ>ÝiŽBò…ÁSÃœ â„¢+‚ˆìÚ0Tcªö¤3.Ã¥2™¦»Æ63¸eOÖšß»F•ñóq·©B,ILLT³2†=‡éHà¨-ÔTHÏ$ BŸ˜gSZS‰¨B0ïWÊE‡´Š{ð â€œÃ³Ã¾uÛ— çiÉ8ïÏ$T“Ü# © ATżÞhV‚rOAþ}+H‰ â€™@øîURIÝß5.#Ý»ƒŒŽ„RÌ® bÄ¿è:cÂ¥0¡XžgRç'{]BÑn@.FYŸo|àT.öáع€zâ¬0y.Öê3Ò¡òc%”‘ò˜­’±¬·´HwexPzóP·ïïÚru?Jµ$ Fñ1PAÃŽ=øçëM`ìS´ ;Ëœsô­Ó2hÆ’`$;3Ã…F¬UÃ#ύ=Ó¤ÂÇ“+dd`wªÏ,@ …ŽW®[äÖôÕɵŠ³Ü,… õü)±S€ùqïRÃœ(w±DelϽUmˆâË×+¶!‘²3æÎW×Þ™+9TRB¹Œ·Ë‘·ž”é[Ç·†9;œð Vi–p×H£äb6ö#Ú·Œ5Â¥wºTÝ&w¶0WÆ’UÃ¥fL²©IÈaê;T“\C‚@!‡ÞóŠ›Lµšò÷2λ(PðGµz¸J-»"d[ÐôT»•žâ2c~ONk¼·x`1ÁÁŒ¨Â¨X[¬XB`€:~]ªìoȬŒô¯¦¥‡QD¥ÓÆÌèÙ“§#•®ÛÞ0Ôì$HwpÕÁ[@î¹þ¬dtù‰õ­;o?ÍFûÙäcªkÓj>îçM&›´¶=3[qz¶÷±€RBYyôë\äÖûÃçaÃœ{úUË CÍ´r7˜¬üÇÜÕ#l ¹!›'9ñŠóàœtg§OH¤HVG4*§ÔsŒ÷ü*""©y…~W$u9íô«¶Î`ÀrÜö¨V Èä¯åZÃ’3$rH\Jà…èsé\‹|7圓2®å·±¯@—§ñ_QYºtRE*å¹EfÈëô®¬;¶ç zw>v¿ÓÂE@|ª{Æ’\VȤ2ð6TŸsëô¯^ñfƒ½ÈFÄ” r>µç÷Vžc²»G>ÃŒ=«ÑZ£Å­Vu1@±B3†tEÃð¬yá*÷l®@vSÚŠ+竤–‡Zlîü9¤ÚÃ(ù¦l“]ÄLÊÈ„Ý´¯¯¾h¢¼Ú¬Ò2cžvŽX ¹öÒDziJ3†Àü(¢¹^å©2·ö|2JŒä‘'Ž)g‘¢ºD(`c¦h¢­6R›,„`Ã…]·¨|Ã’Kkˆ^ãyÃŽsŽÔQPÙ2“+ÎÂ6ÃŽ72Á8ïI²<EXü¬#ùQEDÙ<ÃŒwi›Ô`N}ª|¼nˆ9@Ã…VNLNLÅ¡X²©&yV}/š´|à³{Å¡(Â¥v LÂ¥"[‡<íö¡epQóþ·‚=QvW3êëìÑ, Â£ho­_Ã’u)ï-ZwÀx»ŽäQEiOS7&Yq,¨&2„vÀ·½rZ®¯%®Ù‚n2n\pVˆÍÉœ¥Î¯<ë+W‹…$k윒Lq°PyéEÕOá%¶UÑ£º–ñÎcûG €3øW©hÅ¡e¦“¦Ÿ².Р#z¾îIcõ¢ŠÑ¡\Ó29Õ¹Û*t7›Ž6ãÁÏN(¢¹äÝÊ‹.¬‰n«6ÒÍœrúÕ|[†E•X®¾¹íE›lÑ6M{‘‹…Êji”—ÝdžôQ\³nãæe·o,DOÍæ8öÍK!Ü›ˆêÅVKpRfMÔRÅú²1Å fŽDã*ÙÈ¢ŠÙIØ–ÝÍ4‘¥]¹* pþuBðF²"F»WcïƒE)²Ô™PÁm 8öªÊ É&X·Í€ àíEîÁÉšI++8@F¹ÀïVln¥»phìQv+³rÃ’"ÃŽ#==+f)¼ÔhàûÑE&ÙJL¡<(àƒUÃ¥&\ÇQY©0æeYaŽ)² â€ÃµÂ¨& Å \X.rh¢´M“Ìƺ#¤YP ç#­$ ríÚr3E®î&Ø“ ’ÂÁíQÅ‚®ê6áú (ª»&ì{m;F7!'ëP|ÙÄ;B¨¾”QN/P»"’i^58ëƒéQùï%Æ=}袺‘ ³€Ô|y¯[ë=œ¦µ•%R9ÉSžã¥}5àŸÜøŸÃ:fµsÃ…5Ôdº)ÈÊœd}h¢½ì«©:*(¢½’BÅ ( wYð†“qa0£tv˜ºžX“’±¯+½»¹@°«‘LÛþÒŠ+òþ5£NÊrŠ³”uó³=ü¢rqq{!–í1–9e‘¤nœûÖŠßÏ¢Àóç.OµWÂ׊å=”a¹’MÄœŠ¹§j6‰ˆüű“ïEà*Ҥ5(;4*‘R‹OcR-F{‹¢dÆWrÅ“w«°,~HoŽ?Eîåõg:üÒwn÷ü”U‘r1…Qž”ã-»¾(¢¾Î1\§ îh;HˆþòŠ‚ó—O÷MWØfËU=½ÃnŠç;sž”â¡SЊ(¯—¦’#[â„¢2ÛÆó²r67\òi·šm­Õ³3.Nr(¢±KVMÝÏ<×tÛ1rÁfl{渫Ÿ1¥ƒ•Tlíô4Q_e‘IʃO£ÐúLªNTìÊí…1‚vºƒLÕI­•%,NJ¡(¢½–‘é[S>[P’à9áš«2£:FZ(¦’3’³#‘6Ê}ZåùÀ¾HʃøÑE6‘$PLZ7@v/˜í¶P§$(8õ¢ŠžTL‘ qóàcj€>„T+tî»#¯QO• ) $ä„cæ œõ¦Í¬3»#‘EI"Å¡D©ˆÉ´õÛøgÅ¡VS´~Z(§b$•ÈÌÞXۆf¤Ug·2–åÉíÒŠ(Id>XC«Œî æ"ƒ€îÙýš(§d+4Q¾AÈbŃÐÚ«Én#2cûµ={âŠ*l‡`‰»×$nÛϵ# !f, /n(¢¦È¤‘f§f@ôÍ žSň!Xc®}h¢©$;"¼.|ée!;P%”ÈW#iPÃŽ™¢Š«!ØV@²2uÆj/-[s?$dÊŠ*Ã’4‚Lhð¬0y\úÔÞcy‰»Éü袓EIY"•fRw`ç&œ’33Ç„©9Å¡(©²";B„dmðqæo`1òžüQE.TZZ߆ÚTnÈœŠ$ÈL‹’‡Š(¡¤W*+,ƒÎ› +`N)éw- Å“†•P©ëEώB¢äšºg5D™Ûi÷r>ÕhläjÛ´–Gܬxn0;bÅ +òœÎ§‰8­v8{2[ƒÁÝÆ >ÚîbYÁÁQEyÅ’V$óJL‘0ã&”K$l°¡ëŠ(¨%¤=.Â¥2!$çùTìÏŒç;UÏ=ÍPeö¬F·,|ðÊ RHJyJpÃåažÔQL»ŒÓI ‹vÕÜÝGý¡)–höŒGß¹ÅS3¨ì´VSíçænr:Š–U)åÉœ™ÒŠ(9\äRpQ—$°`8>ôÓ4ï t}˜§z(«Bö’I‘¶¾ Ø0j9îPÃŒp.Þ¦qE¬dÁÍ‘JYÃ’'æÔ1Bž\²¦h¢µæd91>ΈcpNí¹'=MgÃœ\ÉÈ8>csE­&Ü’brc¤´;#”HAÚ¼V|Á¢vˆà“œzóEéSÅ !É”Ò2;¶1Ûš­ç3$’‚´{àQEuD‹²'2I‡rCò«,HŠ»h¢ºiî;²ˆc4Ê¿tU#ñ®ºÒ(`€¬H\Þ´Q_A—EsÍ»›ñ?â„¢g£œŠ· »•p2›‰Ç'4Q^ýÉ»,ÁxÃ¥\˜ãÛ«o+¬BY íOµTÈÖhê´›—’5$PG®}ë^îü¨äa“¸·>¢Š+Å QW=jÇR¬mÃ¥!0\¡È=3RÜüÛY¸4QMA2«]•SËqÆ}1QÝ[ªJ3}×rs×ÒŠ+HE#Š´šv8oé©qdÒ»œçǵxÍìÀ·ï¿N{QEvCDy5õgÿÙ -----------------------------22444249596590--


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 01 June 2015 - 07:18 AM

The error which you have seen is related to php version, if you can upgrade php, then it will be alright

 

currently I am working on

[akshay@localhost tmp]$ php --version
PHP 5.5.14 (cli) (built: Jun 27 2014 11:23:47) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

Please upgrade php and try this attachment

 

 


Ador El

Ador El
  • profile picture
  • Member

Posted 02 June 2015 - 05:44 AM

I will try it out, However I have a system in godday and they are special and can not upgrade it if I do not pay.....

 

 

I changed some lines of Grocery_CRUD_Multiuploader.php  to make it work with PHP 5.3 as you can see, and I got those issues. I believe it has to do with javascript rather than PHP as everything is ok, but after insert data as I get NULL ...

 

Could you please suggest other solution rather than updating PHP version, Those godaddy guys are special...


neoblack

neoblack
  • profile picture
  • Member

Posted 06 July 2015 - 08:20 AM

Can upload file .rar and .mp4 ?


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 06 July 2015 - 10:00 AM

Can upload file .rar and .mp4 ?

 

Yes you can upload.


neoblack

neoblack
  • profile picture
  • Member

Posted 06 July 2015 - 13:11 PM

Help me, My code
 
$config = array(
"path_to_directory"       =>'assets/grocery_crud_multiuploader/GC_uploads/zip/',
"allowed_types"           =>'rar|mp4',
"show_allowed_types"      => true,
"no_file_text"            =>'No file',
"enable_full_path"        => false,
"enable_download_button"  => true,
"download_allowed"        => 'rar|mp4'
);
$crud->new_multi_upload("news_gallerys_zip",$config);

 

But can't upload file *.rar, *.mp4 

 

 


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 07 July 2015 - 06:06 AM

Okay,   please open application/config/mimes.php and add types like below, I think you are using CI < 3.0.0 that is why mp4 type is missing in mimes.php

 'mp4'   =>    'video/mp4',
        ...
        ...

Here is a content of mimes.php

[akshay@localhost config]$ cat mimes.php 
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types.  It is used by the
| Upload class to help identify allowed file types.
|
*/

return array('hqx'	=>	array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
				'cpt'	=>	'application/mac-compactpro',
				'csv'	=>	array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'text/plain', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/x-c'),
				'bin'	=>	array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
				'dms'	=>	'application/octet-stream',
				'lha'	=>	'application/octet-stream',
				'lzh'	=>	'application/octet-stream',
				'exe'	=>	array('application/octet-stream', 'application/x-msdownload'),
				'class'	=>	'application/octet-stream',
				'psd'	=>	'application/x-photoshop',
				'so'	=>	'application/octet-stream',
				'sea'	=>	'application/octet-stream',
				'dll'	=>	'application/octet-stream',
				'oda'	=>	'application/oda',
				'pdf'	=>	array('application/pdf', 'application/x-pdf', 'application/x-download','application/x-download', 'binary/octet-stream', 'application/unknown', 'application/force-download'),
				'ai'	=>	'application/postscript',
				'eps'	=>	'application/postscript',
				'ps'	=>	'application/postscript',
				'smi'	=>	'application/smil',
				'smil'	=>	'application/smil',
				'mif'	=>	'application/vnd.mif',
				'xls'	=>	array('application/excel', 'application/vnd.ms-excel', 'application/msexcel', 'application/vnd.ms-office'),
				'ppt'	=>	array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office'),
				'pptx'	=>	array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/zip'),
				'wbxml'	=>	'application/wbxml',
				'wmlc'	=>	'application/wmlc',
				'dcr'	=>	'application/x-director',
				'dir'	=>	'application/x-director',
				'dxr'	=>	'application/x-director',
				'dvi'	=>	'application/x-dvi',
				'gtar'	=>	'application/x-gtar',
				'gz'	=>	'application/x-gzip',
				'gzip'  =>	'application/x-gzip',
				'php'	=>	'application/x-httpd-php',
				'php4'	=>	'application/x-httpd-php',
				'php3'	=>	'application/x-httpd-php',
				'phtml'	=>	'application/x-httpd-php',
				'phps'	=>	'application/x-httpd-php-source',
				'js'	=>	'application/x-javascript',
				'swf'	=>	'application/x-shockwave-flash',
				'sit'	=>	'application/x-stuffit',
				'tar'	=>	'application/x-tar',
				'tgz'	=>	array('application/x-tar', 'application/x-gzip-compressed'),
				'xhtml'	=>	'application/xhtml+xml',
				'xht'	=>	'application/xhtml+xml',
				'zip'	=>	array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
				'mid'	=>	'audio/midi',
				'midi'	=>	'audio/midi',
				'mpga'	=>	'audio/mpeg',
				'mp2'	=>	'audio/mpeg',
				'mp3'	=>	array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
				'aif'	=>	array('audio/x-aiff', 'audio/aiff'),
				'aiff'	=>	array('audio/x-aiff', 'audio/aiff'),
				'aifc'	=>	'audio/x-aiff',
				'ram'	=>	'audio/x-pn-realaudio',
				'rm'	=>	'audio/x-pn-realaudio',
				'rpm'	=>	'audio/x-pn-realaudio-plugin',
				'ra'	=>	'audio/x-realaudio',
				'rv'	=>	'video/vnd.rn-realvideo',
				'wav'	=>	'audio/x-wav',
				'bmp'	=>	array('image/bmp', 'image/x-windows-bmp'),
				'gif'	=>	'image/gif',
				'jpeg'	=>	array('image/jpeg', 'image/pjpeg'),
				'jpg'	=>	array('image/jpeg', 'image/pjpeg'),
				'jpe'	=>	array('image/jpeg', 'image/pjpeg'),
				'png'	=>	array('image/png',  'image/x-png'),
				'tiff'	=>	'image/tiff',
				'tif'	=>	'image/tiff',
				'css'	=>	'text/css',
				'html'	=>	'text/html',
				'htm'	=>	'text/html',
				'shtml'	=>	'text/html',
				'txt'	=>	'text/plain',
				'text'	=>	'text/plain',
				'log'	=>	array('text/plain', 'text/x-log'),
				'rtx'	=>	'text/richtext',
				'rtf'	=>	'text/rtf',
				'xml'	=>	array('application/xml', 'text/xml'),
				'xsl'	=>	'text/xml',
				'mpeg'	=>	'video/mpeg',
				'mpg'	=>	'video/mpeg',
				'mpe'	=>	'video/mpeg',
				'qt'	=>	'video/quicktime',
				'mov'	=>	'video/quicktime',
				'avi'	=>	array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
				'movie'	=>	'video/x-sgi-movie',
				'doc'	=>	'application/msword',
				'docx'	=>	array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
				'odt'	=>	array('application/vnd.oasis.opendocument.text'),
				'xlsx'	=>	array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),
				'word'	=>	array('application/msword', 'application/octet-stream'),
				'xl'	=>	'application/excel',
				'eml'	=>	'message/rfc822',
				'json'  =>	array('application/json', 'text/json'),
				'pem'   =>	array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
				'p10'   =>	array('application/x-pkcs10', 'application/pkcs10'),
				'p12'   =>	'application/x-pkcs12',
				'p7a'   =>	'application/x-pkcs7-signature',
				'p7c'   =>	array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
				'p7m'   =>	array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
				'p7r'   =>	'application/x-pkcs7-certreqresp',
				'p7s'   =>	'application/pkcs7-signature',
				'crt'   =>	array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
				'crl'   =>	array('application/pkix-crl', 'application/pkcs-crl'),
				'der'   =>	'application/x-x509-ca-cert',
				'kdb'   =>	'application/octet-stream',
				'pgp'   =>	'application/pgp',
				'gpg'   =>	'application/gpg-keys',
				'sst'   =>	'application/octet-stream',
				'csr'   =>	'application/octet-stream',
				'rsa'   =>	'application/x-pkcs7',
				'cer'   =>	array('application/pkix-cert', 'application/x-x509-ca-cert'),
				'3g2'   =>	'video/3gpp2',
				'3gp'   =>	'video/3gp',
				'mp4'   =>	'video/mp4',
				'm4a'   =>	'audio/x-m4a',
				'f4v'   =>	'video/mp4',
				'aac'   =>	'audio/x-acc',
				'm4u'   =>	'application/vnd.mpegurl',
				'm3u'   =>	'text/plain',
				'xspf'  =>	'application/xspf+xml',
				'vlc'   =>	'application/videolan',
				'wmv'   =>	'video/x-ms-wmv',
				'au'    =>	'audio/x-au',
				'ac3'   =>	'audio/ac3',
				'flac'  =>	'audio/x-flac',
				'ogg'   =>	'audio/ogg',
				'pages' =>      'application/zip',
				'numbers' =>    'application/zip',
				'svg'  =>	'image/svg+xml',
				'webm' => 'video/webm',
				'ogg'  => 'video/ogv'
			);


/* End of file mimes.php */

neoblack

neoblack
  • profile picture
  • Member

Posted 07 July 2015 - 09:11 AM

Thanks


neoblack

neoblack
  • profile picture
  • Member

Posted 08 July 2015 - 06:09 AM

Help me, why can not save data upload (data field upload is null) if use callback_before_insert and callback_before_update ?

 

 

function _before_insert_callback($post_array)
{
$post_array['products_create']= date("Y/m/d H:i:s");
$post_array['products_last_update']= date("Y/m/d H:i:s");
 
return $post_array;
}
 

 


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 08 July 2015 - 09:26 AM

I am sorry, I didn't understand your problem, could you please elaborate


Allan Alvarez Ortiz

Allan Alvarez Ortiz
  • profile picture
  • Member

Posted 16 July 2015 - 06:13 AM

Hi, nice plugin really appreciate it, but i keep getting this error:

 

A PHP Error was encountered

Severity: Runtime Notice

Message: Declaration of Grocery_CRUD_Multiuploader::upload_file() should be compatible with grocery_CRUD_Model_Driver::upload_file($state_info)

Filename: libraries/Grocery_CRUD_Multiuploader.php

Line Number: 963

I don't know if you can help me


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 21 July 2015 - 11:23 AM

Hi, nice plugin really appreciate it, but i keep getting this error:

 

A PHP Error was encountered

Severity: Runtime Notice

Message: Declaration of Grocery_CRUD_Multiuploader::upload_file() should be compatible with grocery_CRUD_Model_Driver::upload_file($state_info)

Filename: libraries/Grocery_CRUD_Multiuploader.php

Line Number: 963

I don't know if you can help me

 

Hi Thanks for reporting, kindly download updated file from github

 

https://raw.githubusercontent.com/Akshay-Hegde/grocery_crud_multiuploader/master/application/libraries/Grocery_CRUD_Multiuploader.php

 

- Akshay


Ador El

Ador El
  • profile picture
  • Member

Posted 23 July 2015 - 06:56 AM

Hi  Akshay, I've got the same issue @neoblack has:

 

The issue presents when inside the $crud you set either callback_before_insert or callback_before_update like

$crud
         ->callback_before_insert(array($this,'my_callback')    )   
         ->callback_before_update(array($this,'other_callback')    )  ;

When added to crud, the uploads are correct, however, when saving data and returning to list view, the value for filelds set as upload type will have a null value, in other words, files url are not being saved as field values

 

You would get "No files" as value in view list

 

If I comment these callbacks everything works fine.

 

How to solve the callback issue?


Akshay Hegde

Akshay Hegde
  • profile picture
  • Member

Posted 28 July 2015 - 07:52 AM

Hi  Akshay, I've got the same issue @neoblack has:

 

The issue presents when inside the $crud you set either callback_before_insert or callback_before_update like

$crud
         ->callback_before_insert(array($this,'my_callback')    )   
         ->callback_before_update(array($this,'other_callback')    )  ;

When added to crud, the uploads are correct, however, when saving data and returning to list view, the value for filelds set as upload type will have a null value, in other words, files url are not being saved as field values

 

You would get "No files" as value in view list

 

If I comment these callbacks everything works fine.

 

How to solve the callback issue?

 

Hi Sorry for late reply, I was out of station, this issue has been fixed in current release, it was due to callback override

 

Go through github, let me know if you find any difficulties

 

https://github.com/Akshay-Hegde/grocery_crud_multiuploader

 

Regards,

 

Akshay