Multiple file upload library |
[eluser]Romyblack[/eluser]
Hi Everyone. I'm new at this and am a fan of this incredible CodeIgniter Framework, here i share with you this libraries to upload multiple files, it have been documented for easy integration. I hope this is useful for you. /*UPDATED 6/9/2012 I updated the library according to your need now you can upload with file arrays or normal file inputs as well, hope you enjoy. If you find this library helpful please say thanks and share it with people you know need this. *********************************** /*UPDATED 21/10/2012 Hi everybody, i modified this library as you requested, first at all. Special thanks to frankabel and Pent to help me improve this library, ok so now the problem with the appended texts of error was resolved and now, the array that the library returns has a new attribute called [FILE_INPUT] which tells you from which input field the file was submitted or selected. Example Code Code: 'file_name' => string 'NCF_BLOQUEADOS.txt' (length=18) I hope you enjoy. Cordially, Romyblack. Quote:Save this with this name (MY_Upload.php) Quote:PayPal library released see post <here>
[eluser]mattsmith[/eluser]
Thanks a bunch! This saved me like an hour of obnoxious work. I did get a vague permissions error when trying to create the index.php files(but I didn't need those).
[eluser]Romyblack[/eluser]
[quote author="mattsmith" date="1327013800"]Thanks a bunch! This saved me like an hour of obnoxious work. I did get a vague permissions error when trying to create the index.php files(but I didn't need those).[/quote] You're welcome, you can modify the library to your needs, the problem you're having is because of the file's permission. In the console try this. if the folder where you want the files to be uploaded is downloads Code: chmod +rw downloads The script will have permissions to write a file on it Hope this help.
[eluser]mattsmith[/eluser]
No, the upload directory was already set to 777. If that were the problem, it wouldn't be able to upload the files themselves.
[eluser]Romyblack[/eluser]
[quote author="sony144" date="1327187937"]Huge help thanks for this.[/quote] No problem, its a pleasure to help you with this little thing. I feel very good
[eluser]pierrest[/eluser]
Hello everybody, This library was workin perfect on my dev server, but now just deploying my project to the production server and i get this message Call to undefined method CI_Upload::up() my controller: Code: <?php have been for a while on it and i am lost... i have some rewriting htaccess stuff too which was not on the dev server: (there is an evil joomla project on the same sever (which i did not develop myself) i use a subdomain for CI) php_flag "allow_url_fopen" "On" php_flag "allow_url_include" "On" #AuthType Basic #AuthName "Le site est en maintenance, veuillez repasser plus tard" #AuthUserFile /home/www/c5f672d79af39528e95ff68c3587e35e/web/members/.htpasswd #<Files index.php> #require valid-user #</Files> RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] is it this rewrite which may causing the problem? Thanks a lot if you can help me
[eluser]Romyblack[/eluser]
[quote author="pierrest" date="1328542923"] RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] is it this rewrite which may causing the problem? Thanks a lot if you can help me[/quote] Hi pierrest, please verify that you paste the library in the correct folder and named like this MY_Upload.php, remember that when you put this library in your library folder, (not the core's library folder), it calls it automatically and override the functions with the same name. Another thing, to confirm if your .htaccess is the problem, in your upload controller, call another library to see if it works property, if not then the problem is the .htaccess. if yes we'd better find another solution. let us know the results.
[eluser]InsiteFX[/eluser]
Some servers are case sensitive and need all filenames in lower case!
[eluser]pierrest[/eluser]
File was named MY_upload and not MY_Upload.... :red: It works now, library found, but it return nothing => bool(false) ... but the files are uploaded at the right place EDIT: The problem was me again...=> i commented the whole if condition at line 113 of MY_Upload (#Here we do the upload process) to let the upload optional. sorry to disturb for such things.... |
Welcome Guest, Not a member yet? Register Sign In |