Codeigniter Multiple Upload Images/ files / video / audio files - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Codeigniter Multiple Upload Images/ files / video / audio files (/showthread.php?tid=49429) Pages:
1
2
|
Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-19-2012 [eluser]alexaaaaaaaaaa[/eluser] Hi all, this is nothing new but i thought that maybe someone will use this in the future. NOTICE. The code it's not mine but i'll share it anyway so what do you need jquery and a new jquery plugin you can get them from HERE once you get them create 1 controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); then create 3 view files in my case under the admin folder upload.php in this file copy paste the code from the jquery file and change the path to the js and css files and the form action url then create upload_success.php Code: <?php Code: <?php If you have problems i'll be glad to help you. Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-19-2012 [eluser]InsiteFX[/eluser] IS_AJAX is useless because it was never defined as a constant! Besides CI has its own ajax check now! Code: $this->input->is_ajax_request(); See the input class... Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-19-2012 [eluser]alexaaaaaaaaaa[/eluser] [quote author="InsiteFX" date="1329661815"]IS_AJAX is useless because it was never defined as a constant! Besides CI has its own ajax check now! Code: $this->input->is_ajax_request(); See the input class... [/quote] yeah that's correct! thank you Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-24-2012 [eluser]Irvana[/eluser] I am very newbie at this (codeigniter) stuff. Just wondering how to connect with database and make it direct to file path? Thanks a lot. Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-24-2012 [eluser]alexaaaaaaaaaa[/eluser] [quote author="Irvana" date="1330144581"]I am very newbie at this (codeigniter) stuff. Just wondering how to connect with database and make it direct to file path? Thanks a lot.[/quote] hi Irvana, if you want to connect your codeigniter to database please go here application/config/database.php and edit your file to match your configuration, also in the same folder config you have the config.php where your can setup the url of the file and the secret key if you didn't setup those ... Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-24-2012 [eluser]Irvana[/eluser] ok...just confuse with upload.class.php at folder server. how to modify upload directory from this script Code: 'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/files/', i am sorry for my question but totally stuck when i try to modify the script without "$_SERVER['SCRIPT_FILENAME']" because error appear when i upload the file --> SyntaxError: Unexpected token < Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 02-25-2012 [eluser]aquary[/eluser] Mostly I use './folder/' for the upload folder... never found a problem with that one. I guess the "./" is relative to the index.php which on the root ? But your error... seems to be more about you forgot to remove something along with $_SERVER['SCRIPT_FILENAME']. Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 08-04-2012 [eluser]RockyS[/eluser] This code doesn't work with latest CI. Any updates? Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 08-04-2012 [eluser]alexaaaaaaaaaa[/eluser] [quote author="RockyS" date="1344074781"]This code doesn't work with latest CI. Any updates? [/quote] what problems do you have? Codeigniter Multiple Upload Images/ files / video / audio files - El Forum - 08-04-2012 [eluser]RockyS[/eluser] After submitting the form (with files) I get no error and no progress either, files aren't uploaded, I have created 'uploads' folder in CI root http://s18.postimage.org/bt111wlt5/Capture.jpg And btw, how can I change upload directory dynamically with the same form? (I want to have multiple folders ex. banners, images, pdf,doc etc..) User can choose folder from select box. Current script: Code: if($.fn.wl_File) $.fn.wl_File.defaults = { modifying Code: 'upload_dir' => dirname(__FILE__).'/uploads/', To (doesn't work) Code: 'upload_dir' => dirname(__FILE__).'/'.$_REQUEST['folder'].'/', Because I get 'Undefined variable: folder' |