cancel
Showing results for 
Search instead for 
Did you mean: 

upload zip files and automatically extract into folder

davidturner90
Champ in-the-making
Champ in-the-making
Hi,

I am writing a custom script that runs when a zip file is added to a folder space. The script will automatically extract the content of the zip file and place the content items in the target folder.

My approach is to create a content rule based on the condition that the file pattern matches *.zip. This executes a custom script that unzips the contents into the space. If the zip contains content items that have the same name as content items already stored in the space then an error message is displayed informing the user that an existing file or files already exist and provide the name(s) of the existing files.

I would appreciate any comments on this approach and also has anybody done anything similar?

Thanks
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
That would be very handy, and yes the approach sounds fine.  Have you thought about creating a forge project (http://forge.alfresco.com/) so that other interested developers can help out?

FWIW I've wanted to do something like this for a while now, but never seem to find the time.  😉

Cheers,
Peter

pmonks
Star Contributor
Star Contributor
A slightly different approach that I'd envisaged was a Web Script that allowed the user to type in (not browse, since that's a security problem) the location of a zip file on the local filesystem and select a target space in the repo, and the script would explode the zip directly from disk to that space.

This would probably be more of an administrator use case then an end-user use case (since the zip file has to get into a local filesystem on the Alfresco server first - something that end users probably won't be allowed to do), but could be quite handy nonetheless.

Cheers,
Peter