Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 01:46:41 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Media Folder: Automatic Unzip File  (Read 4011 times)
Hilltop

Offline Offline

Posts: 16


« on: February 02, 2007, 11:26:26 PM »

Hello everyone!  I have modified the Media module of WebsiteBaker 2 to allow the user to upload a single ZIP file which is then automatically unzipped into the upload directory.  This saves a HUGE amount of time when uploading pics to gallery directories, etc... 

I wanted to post my modifications here so that you WB experts could review them and let me know if I did this correctly, or if I left huge security holes open, etc... ( grin).  I would really appreciate your feedback on this.

I had to modify the following files:
./admin/media/upload.php
./admin/media/template.php

I am attaching these files here as a ZIP file.
(If the attachment doesn't work, email me and I'll post them on my site.)
« Last Edit: February 02, 2007, 11:27:58 PM by Hilltop » Logged
Hilltop

Offline Offline

Posts: 16


« Reply #1 on: February 21, 2007, 05:17:00 PM »

It appears that a bunch of people have read this post but no comments.  I hope I didn't do something wrong or offend someone.

Just trying to help make WB a better CMS...

Thanks,

Hilltop
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #2 on: February 21, 2007, 05:25:47 PM »

Hello,

sorry for not answering. Like your idea and will download and test the files. If there are no issues maybe we can add it to WB.

Thanks for your Work

Matthias
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #3 on: February 21, 2007, 05:37:23 PM »

Personally I must have overseen this ... in gerneral the idea is good ... but the code audit I'll leave to somebody else.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

pcwacht
Guest
« Reply #4 on: February 21, 2007, 06:13:04 PM »

Did a brief look at the code

In template.html, line 87 is hardcoded text, best is to put this in the language file.

maybe even move the tick box, create extra unzip lines under the 10 uploadfile spaces to keep persistantie with the layout.
The text pushes down the next lines

upload.php
This looks like a typo to me?
line 105
Code:
if (isset($_FILES['file1']['name']) & isset($_POST['unzip']) )
shoudln't it be:
Code:
if (isset($_FILES['file1']['name']) && isset($_POST['unzip']) )

It looks like you leave the zip after unzipping?
Might be a nice option to ask user if he wants that

Further no strange things detected, it looks good to me security wise.

Did you test this with directories in the zip? Does it recreate a zipped directory structure?


John
« Last Edit: February 21, 2007, 06:17:30 PM by pcwacht » Logged
DGEC

Offline Offline

Posts: 386


WWW
« Reply #5 on: March 06, 2007, 10:52:00 PM »

This looks like a great idea. Hope it is able to vetted soon!
Logged
Hilltop

Offline Offline

Posts: 16


« Reply #6 on: March 08, 2007, 03:10:49 PM »

Thanks so much everyone for your input on this! 

From your suggestions I see that there are still some things to work on, so I'll keep at it.

No, I haven't tested with a ZIP which contains directories.  I will try that a.s.a.p. 

Yes pcwacht, you are right it should be && instead of &.  Sorry!

I have not learned enough about the language files to do this yet, but will keep in mind.

I didn't think it necessary to have multiple boxes supporting the unzip feature, since a single ZIP file can contain all the files which the user desires to upload.  What does everyone think?

Yes, good idea about deleting the ZIP file, but this would add a great deal to the complexity if you have to ask the user each time.  If we automatically deleted the ZIP, that would probably okay, but it's just as easy for the user to click "Delete"...

I wonder how hard it would be to have another button called "Unzip" next to each ZIP file in a directory, that way the user could unzip a file without having to manually upload it at that time.  I might tinker with this soon...


Thanks again everyone and I'll look forward to your comments on this as I fix these issues!
Logged
DGEC

Offline Offline

Posts: 386


WWW
« Reply #7 on: March 12, 2007, 05:08:53 PM »

I like all the ideas actually smiley

Regarding having multiple boxes, it would be nice, but only if you can keep the interface clean. About deletes - maybe have a "unzip and delete file" checkbox?

I found a free file manager with unzip... somewhere... where was that....

Being able to upload the zip and leave it there definitely is nice for recovery if nothing else. As it is, it's a great step forward.

I have a bunch of MP3s and PDF transcripts that I'm going to be uploading soon, so this is perfect. Oh wait. I hope they're not too big.
Logged
erpe

Offline Offline

Posts: 2077


WWW
« Reply #8 on: September 18, 2008, 01:59:13 PM »

Hi Hilltrop

any improvements on this module?
It doesn't work with wb 2.7.

Are you still working on this module?

rgds

erpe
« Last Edit: September 20, 2008, 05:58:34 PM by erpe » Logged

Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #9 on: December 07, 2008, 10:35:54 PM »

Same question as Erpe,

This mod is exactly what I was looking for! But indeed not working under 2.7.

*bummer*  cry
Logged

...:: Bake the Unbakable ::...
doc
Guest
« Reply #10 on: December 07, 2008, 11:49:14 PM »

Hello,

have had a quick look an did some changes to get the automatic unzip function working for WB 2.7.
As I have not had the time to test the fix properly, remember to backup the following files: /admin/media/template.html and /admin/media/upload.php

Tested with a ZIP file without path information, just some files in it. Does only work for the very first file as in the previous version posted by Hilltop.

Regards Christian

P.S.: Once we found a stable solution, it may be an option for WB 2.7.x ...
« Last Edit: December 07, 2008, 11:56:40 PM by doc » Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #11 on: December 08, 2008, 09:30:54 AM »

Hi Christian,

Thnq for picking this up. I think Hilltrop his idea is a very good one.

I tested your modified version:

- uploaded the 2 files in the admin/media/
- created 1 zip file containing 2 directories (So 1 main directory, 2 sub. The pictures in the 2 subs)
- uploaded it
- Worked like a charm

After this I uploaded another zip file which went successfull too.

I only tested it with .jpg files.

So overall it looks good.

Personally I think this mod suits perfect with the uploader module: http://www.websitebaker2.org/forum/index.php/topic,9087.msg71570.html#msg71570.

Thnq again for taking the time to get it work for now.

Greetz
Boudi
 
Logged

...:: Bake the Unbakable ::...
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!