⚠ 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 forum is read-only and soon will be archived. ⚠


Grocery_Crud_Multiuploader library

multiupload

  • Please log in to reply
23 replies to this topic

#1 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

Posted 22 December 2014 - 03: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/A...d_multiuploader

 

https://codeload.git...ader/zip/master

 

Thank you all.



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts

Posted 22 December 2014 - 04:16 PM

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



#3 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

Posted 22 December 2014 - 09:27 PM

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

 

 

 

Thank you



#4 Peter

Peter

    Member

  • Members
  • PipPip
  • 25 posts

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 :)



#5 Alan Fernandes

Alan Fernandes

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 January 2015 - 11:55 PM

thanks for shared!!! :D



#6 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

Posted 11 March 2015 - 11:44 AM

thanks for shared!!! :D

 

You are welcome.



#7 Ador El

Ador El

    Member

  • Members
  • PipPip
  • 12 posts

Posted 27 May 2015 - 06: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/19...-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--

Attached Thumbnails

  • grc.png
  • grc.png

Attached Files



#8 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

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

 

 

Attached Files



#9 Ador El

Ador El

    Member

  • Members
  • PipPip
  • 12 posts

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...



#10 neoblack

neoblack

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 06 July 2015 - 08:20 AM

Can upload file .rar and .mp4 ?



#11 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

Posted 06 July 2015 - 10:00 AM

Can upload file .rar and .mp4 ?

 

Yes you can upload.



#12 neoblack

neoblack

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 06 July 2015 - 01: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 

 

 

Attached Thumbnails

  • error.jpg


#13 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

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 */


#14 neoblack

neoblack

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 07 July 2015 - 09:11 AM

Thanks



#15 neoblack

neoblack

    Newbie

  • Members
  • Pip
  • 6 posts

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;
}
 

 



#16 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

Posted 08 July 2015 - 09:26 AM

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



#17 Allan Alvarez Ortiz

Allan Alvarez Ortiz

    Newbie

  • Members
  • Pip
  • 4 posts

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



#18 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

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.githubus...ltiuploader.php

 

- Akshay



#19 Ador El

Ador El

    Member

  • Members
  • PipPip
  • 12 posts

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?



#20 Akshay Hegde

Akshay Hegde

    Member

  • Members
  • PipPip
  • 14 posts

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/A...d_multiuploader

 

Regards,

 

Akshay







Also tagged with one or more of these keywords: multiupload

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users