## Resource types

### Upload of Multiple files

Upload of Multiple files

Dear everyone,

I notice that files that required to be upload through the Moodle interface can only be upload one at a time. Is there any other way(s) to upload multiple files or even a directory (or maybe even multiple directories that contain files & sub-directories and then after upload into the Moodle directory, it will still retain the directories structure)

Probably we can have this new function/features added into the Moodle system? That would certainly help to save a lot of time rather than upload one file at one time.

Average of ratings: -
Re: Upload of Multiple files

Try zipping the files/folders, uploading the zip file to Moodle, and unzipping from there. That should allow you to upload multiple files and complete directory structures.

If you do this, though, be aware that when you upload a single file Moodle checks the name and if necessary changes it to one which won't cause Moodle a problem when you try to access the file (primarily it gets rid of spaces in file names, so Doc 1.doc becomes Doc_1.doc).  When you unzip files Moodle doesn't get chance to check the names, so you could end up with problematic file and folder names in your moodledata folder.  Just make sure that all your files and folders are suitably named before you zip them, though, and you should be okay.

HTH

Chris

Average of ratings:Useful (3)
Re: Upload of Multiple files

You could also try the flashupload hack by Helmut Geppl. It is availiable from

The site is written in german, but I think even the installationguide is written in german as well you could understand it.

I use this tool and it is very useful!

Average of ratings:Useful (2)
Re: Upload of Multiple files

Google translates it quite well.

below are the link to the web page, and the converted readme file

=========

Moodle Flash upload by Helmut Geppl

(Allows the upload of multiple files in a browser using Flash)

(Open source MIT license)

Installation instructions:

1st The contents of the ZIP file completely to $moodledir / files / copy. 2nd The flashupload.php file from the folder "de_utf8" to$ dataroot/lang/de_utf8 / copy

($Dataroot be obtained by the Moodledata directory example: "/ srv / www / moodledata" under Linux Or c: \ moodledata "or" c: \ xampp \ moodledata "replace Windows). For English is the file from the folder "en_utf8" to$ dataroot/lang/en_utf8 / copy

Other translations, there is not. So you have the file from the folder flashupload.php "en_utf8"

In each subdirectory in the directory $dataroot / lang / (eg: ru_utf8 for Russian) copy and adapt. 3rd Backup File$ moodledir / files / index.php (eg copy "index.php.orig" create)

4th $Moodledir / files / index.php modify: (Modified_index.php the file is the file of the Moodle modified version 1.8.3) The file modified_index.php open and the section between / / Modification by hgeppl ... / / Modification by hgeppl Into its own folder in index.php$ Moodledir / files using copy and paste to insert the following:

B) At the end of this function before the line:

Echo "<table border =" 0 \ "....

Copy the section into it.

Done!

======

larry

Average of ratings:Useful (1)
Re: Upload of Multiple files
works great thanks !
(moodle 1.9.2)

Average of ratings: -
Re: Upload of Multiple files

Is anyone able to give me a better translation of this? I'm ok until I get to editing index.php at which point I get really quite confused.

Mike

Average of ratings: -
Re: Upload of Multiple files

Average of ratings: -
Re: Upload of Multiple files

Thanks for pointing that out- I now have it working fine

Mike

Average of ratings: -
Re: Upload of Multiple files

For some reason I am getting 404s from this in IE but works fine in FF. When you try to upload, the green boxes for the files go red and state 404 error before dissapearing

Anyone got any ideas to fix it?

Thanks,
Mike

Average of ratings: -
Re: Upload of Multiple files

In version 2.2.0 of "Moodle Flashupload" there is a fix for this bug. The 404 error occured because IE doesn't interpret the path to the "upload.php" the way FF does.

Helmut

Average of ratings:Useful (1)
Re: Upload of Multiple files

Thanks for sorting that, I've just tried to download it but get a 0byte file

Thanks,
Mike

Average of ratings: -
Re: Upload of Multiple files

the 0byte file was produced by an error in the cms. I've now fixed the problem.

Helmut

Average of ratings: -
Re: Upload of Multiple files

Thanks for that, it does seem to have a bug that it will only upload to a course's root directory Does this happen to everyone or it it because of a mdification I've made to my file upload page?

Thanks,
Mike

Average of ratings: -
Re: Upload of Multiple files

I've testet it on several platforms and i didn't have such a problem. If you attach your personalized upload.php, i can help you to solve the problem.

Helmut
(which os, browser and flash-version are you using?)

Average of ratings: -
Re: Upload of Multiple files

Find attached. I've added some code to allow the selection of files from parent metacourses.

Thanks,
Mike

Average of ratings: -
Re: Upload of Multiple files

i tried your index.php, but without success. Are there any other files you've modified? Can you attach your complete source or mail it to me. Otherwise i won't be able to try your code.

Helmut

Average of ratings: -
Re: Upload of Multiple files

I've made modifications to various files, but I'm pretty sure that is the only modified file that has anything to do with uploading files. What errors are you getting?

Thanks,
Mike

Average of ratings: -
Re: Upload of Multiple files

i tried your index.php with another moodle-installation (v. 1.9) and uploading works. The first time i tried with an 1.8.2+ version of Moodle (it seems you've version 1.9 or so installed, please correct me if i'm wrong).
Are you really using the new 2.2.0 version of "moodle flashupload" ?

Sorry Mike, i didn't have time to try this earlier..

Average of ratings: -
Re: Upload of Multiple files

I'm running 1.9.1 and V2.2.0

It works fine if uploading to a course's root directory, but if I go into a subdirectory and try to upload it goes through all the motions but the file isn't actually there afterwards.

Thanks for looking into it,
Mike

Average of ratings: -
Re: Upload of Multiple files

I think I may have found the problem- file permissions.

I sometimes upload large files and folders containing lots of files over ssh, I've just run into the problem again and realised that www-data user didn't have permission to put the files in the sub-folders. I've set the permissions correctly and it now seems to work.

Sorry for wasting you time over me being thick,
Mike

Average of ratings: -
Re: Upload of Multiple files

I've installed this module on my hosted site and it seems to work fine until I try uploading files larger than 2Mb. The upload starts and seems to complete its task but nothing shows up on the screen at the end of the process. And yes, I can upload large files (up to 128MB) in my course using standard uploading (for example, in forum posts). I tried checking out the flashupload.php file for specific upload size settings, but there aren't any I can see. Any ideas how to fix this? I am using Moodle 1.9.5+.

EDIT: in the error_log file, I get messages that look like this:

[14-Oct-2009 08:29:38] PHP Warning: POST Content-Length of 9423398 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

My custom PHP.INI file looks like this:

post_max_size = 128M

Processing time and memory load are not any problem at this point, so I didn't add anything to the PHP.INI file in this regard.

EDIT #2: found it, I just had to add a suPHP_ConfigPath parameter in my root .htaccess file so as to have my PHP.INI file settings recurse through my site folder structure. Works fine now!

Average of ratings: -
Re: Upload of Multiple files

I just want to say thank you for this wonderful Multiple Files Upload patch/hack. It was easy to install according to the English ReadMe instructions that come with the package and it works like a dream. I installed on a test system yesterday and today I installed it on our production system. (Moodle 1.9.5)

Average of ratings: -
Re: Upload of Multiple files

It is a great addition.

Just a minor tweak... I hated having it at the top of the files page when the other controls were at the bottom, and it should NOT appear on "action" files pages like rename, etc.

To put it in the footer (below other buttons), and only when appropriate, do this hack to files/index.php instead of the hack in the readme.txt:

In function html_footer(), right before the line
print_footer($COURSE); add: //HACK -- MOD: FLASHUPLOAD - START global$wdir,$course,$CFG;
//HACK -- MOD: FLASHUPLOAD - END

Average of ratings: -
Re: Upload of Multiple files (now liniking multiple files as well)
I'm interested in the possibility of LINKING multiple files at once.

Click the tick boxes > multiple link.

A rolls-royce version would give you the option of entering link names and description.

However, it seems the way the resource is written this is not simple.

Has anyone done anything with this? ??

Average of ratings: -