Using Drupal 7. I'm a newb, so go easy on me : (

I am building a site, strictly for learning purposes, that is basically an e-learning course portal.

So I have a content type named 'Course'. The course author role would then create a new Course and in the Course type are numerous fields such as title, description, etc. But also a File upload field that accepts .zip files (this is because most e-learning authoring tools publish to zip format, with the zip containing an index.html and a bunch of .swf files/other .html files and some .js files).

What I'd like to be able to do is:

1. Once the user uploads the zip file, it automatically gets unzipped into a new subdirectory.
2. A link to the 'index.html' file that is in that subdirectory (as it was in the previous .zip package) is then made available and listed in that Course's node page.

I looked for a module that would do this but couldn't find any that fit the bill, and most were not Drupal 7 compatible.

Comments

vaibhavjain’s picture

You will to do some amount of custom code go get this working.

use hook_node_presave and use PHP to unzip the file.
After the file has been unzipped and created, you need to identify if index.html exists.
If it does, go ahead and append a link of the same to the $node->body.

Vaibhav Jain

gbestwick’s picture

Hello!

I'm in the same boat as you, and while the responders comment where no doubt accurate, they were a bit above my skill.

Did you get anywhere with this? If you did, I would love to see how you did it, as must do something exactly like that for a site I've been required to work on.

Cheers
Gord

Mixed91’s picture

Hello ! you are solved this problem? I have a similar problem , Drupal 7 , Commerce-file , and I need upload Zip Journal with index.html and more swf , js files , and set to commerce-file field ://private/journal/newuploaderarchive/index.html. If you realize this , help me plz with this . Thanks and sorry for my bad English :D

pandapowder’s picture

I want to do the exact same thing as the op. I'm thinking I would need a custom field type?

JohnRofls’s picture

Two years has passed. Anyone come up with a solution for this?

mark2741’s picture

I never did get around to doing this but I do believe it would be a fairly straight-forward thing to do with a custom module. I haven't done any Drupal work in a couple of years so I can't help : (