Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

upload and unzip a file as detailed page

Quote Reply
upload and unzip a file as detailed page
Hi

Want i want to do is give the possibility to users to add not a single link but a web page on the directory.
I mean when the user clicks on the link instead of going to http://www.site.com /page.html he goes an internal page.

In the table links I have created a field for the attached file. I have modified the link.html template and it is Ok. it works fine with a single html page.

It becomes more complicated with the images present in the html page. I would like to give the possibility to users to upload also the images related to the pages.

I was thinking to give them the possibility to upload a zip file and then automantically unzip it.

Is anyone has an idea on how to do this? Any other idea to realise what I want to do?

Thanks in advance for your answers,

Vercyb
Quote Reply
Re: [vercyb] upload and unzip a file as detailed page In reply to
Are you planning on a maximum number of images per detailed page?
Quote Reply
Re: [Alba] upload and unzip a file as detailed page In reply to
In Reply To:
Are you planning on a maximum number of images per detailed page?
I consider a maximum of ten images,
Quote Reply
Re: [vercyb] upload and unzip a file as detailed page In reply to
I would do this in one of 2 ways (without using zip file).
  • Have a standard layout for your detailed pages.
  • Have your Users upload their text into one field and then have 10 file upload fields for images.
  • Use a global to convert the text field line breaks into <br/><br/>
  • Use

<%if image1%> <%endif%>
<%if image2%> <%endif%> etc.
to call the images into set places in the document. (use the image file global)

...or
  • have your Users upload a .pdf file and use it to replace the detailed URL in links.html
Quote Reply
Re: [Alba] upload and unzip a file as detailed page In reply to
Thanks for your answer. I think it would be a good solution. In the same time I need to do it using a zip file.

I think it could be uploaded as another file and then unzipped through perl and it goes beyond my competencies in perl. Is anyone knows how to do this?

Thanks for your answers

In Reply To:
I would do this in one of 2 ways (without using zip file).
  • Have a standard layout for your detailed pages.
  • Have your Users upload their text into one field and then have 10 file upload fields for images.
  • Use a global to convert the text field line breaks into <br/><br/>
  • Use

<%if image1%> <%endif%>
<%if image2%> <%endif%> etc.
to call the images into set places in the document. (use the image file global)

...or
  • have your Users upload a .pdf file and use it to replace the detailed URL in links.html
Quote Reply
Re: [vercyb] upload and unzip a file as detailed page In reply to
Wouldn't be possible to do this using the tar module used for untar the module?