Forums | Mahara Community

Support /
Mass upload functionality


Olaf Perlick's profile picture
Posts: 19

22 October 2009, 2:39

Hi everybody,

I really lokked forward to the new possibility of unzipping files in the my files section on the server. But after Installing the beta and upgrading the database, I can't find a way to unzip uploaded files.

 Thanx for your help in advance

anonymous profile picture
Account deleted
Posts: 1643

22 October 2009, 17:32

Hi - that's strange, cos it's definitely there. Once you have uploaded a .zip file, you should see an "Unzip" link beside the edit/delete buttons in the My Files section.

Maybe it doesn't appear if you don't have unzip installed on the server?

Also, .zip files should show up with a different icon - they should have a little brown box (package) instead of the text-file icon that most files have. 

anonymous profile picture
Account deleted
Posts: 808

22 October 2009, 18:38

This is working for me on dev.mahara.org, which is running the latest beta.  But I just had a look at the documentation for the PHP zip_read() function we rely on, and it says:

  PHP 4 >= 4.1.0, PHP 5 >= 5.2.0, PECL zip >= 1.0.0

so I guess if that function it's not available between PHP 5.0 and 5.2, that might be the problem.

anonymous profile picture
Account deleted
Posts: 808

22 October 2009, 18:56

Olaf,

Another thing: could you try uploading a .tar.gz or .tar.bz2 file, and see if the unzip link appears for those?  Those file types should be recognised even without the zip_read() function, so if you see the link appear for those we'll know for sure what the problem is.

There will probably be a way to rewrite the .zip stuff without relying on php 5.2.

R.

Olaf Perlick's profile picture
Posts: 19

23 October 2009, 8:34

Hi Richard,

 

I did a clean install of the 1.20 beta and only kept the config.php and my favicon.ico. I tried to upload the files you told me, but nothinghappened.

 

Best regards, Olaf

anonymous profile picture
Account deleted
Posts: 808

26 October 2009, 17:47

When you say you tried to upload the files and nothing happened, I presume you mean the file upload actually succeeded but you don't see an "Unzip" link appear next to them in your files area?

I'm not sure why it wouldn't be working. Could you let me know if there are any errors in the apache log when you upload the files?  Which version of php are you running?

Olaf Perlick's profile picture
Posts: 19

27 October 2009, 5:38

I've got PHP 5.2.10 installed. I don't have root access to my server, so I can't access the apache logs. Icons of zip - files don't appear as little brown packages, and unzip buttons are missing.

 Thanx in advance, Olaf

anonymous profile picture
Account deleted
Posts: 1643

27 October 2009, 18:15

Hi Olaf - out of interest, are you able to run the following query on your database and show us the results?

SELECT DISTINCT filetype FROM artefact_file_files;

(adjust table name to suit your database prefix if necessary). 

Olaf Perlick's profile picture
Posts: 19

31 October 2009, 4:03

Hi Nigel, sorry for coming back to you so late! This is the result of the query:

"filetype"
"image/jpeg"
"application/vnd.oasis.opendocument.presentation"
"application/vnd.oasis.opendocument.text"
"application/vnd.oasis.opendocument.graphics"
"application/octet-stream"
"application/zip"
"application/vnd.oasis.opendocument.spreadsheet"
"application/x-zip-compressed"
"application/download"
"application/msword"
"application/x-binary"
""
"image/png"

anonymous profile picture
Account deleted
Posts: 808

01 November 2009, 17:20

Hi Olaf,

The reason Nigel asked is that we've been relying on the mimetype passed by the browser to tell if a particular file might be an archive (zip, .tar.gz, .tar.bz2).

I'm guessing your browser was using application/x-zip-compressed which we didn't have in the list of mimetypes to check, but I added that (and a few others) the other day. So if you try the latest master (from http://git.mahara.org/?p=mahara.git;a=snapshot) then hopefully it will work.

The worrying thing is that I don't see anything that looks like .tar.gz or .tar.bz2 in your list, so I guess your browser could have reported those as application/octet-stream or something.  That's annoying because it means that to detect them accurately the only option might be to actually open and read every single file that gets uploaded.  I really hope we don't have to do that but it might be the only option.  If you could let me know what browser (and os) you used when uploading the files, that would be great.

Thanks,

R.

19 results