Forums / Setup & design / image download

image download

Author Message

andre müller

Friday 02 May 2003 1:23:24 am

I'm trying to set a link to a downloadable image.
the url i'm typing in just for testing is .../demo/content/download/320/1588 (320 is ContentObjectID and 1588 is ContentObjectAttributeID). I also tried this:
.../demo/content/download/320/1588/file
.../demo/content/download/320/1588/image

but i always get the reply:
The object is not available.

a hint anyone? thanks.

Bård Farstad

Friday 02 May 2003 1:28:45 am

This is probably because of the rewrite rules. If you've installed eZ publish with rewrite rules you will see that all requests except those ending in .jpg .png and .gif will be sent to index.php. This means that downloads of images with these extensions will not work.

You need to add a new rewrite rule, something like:
RewriteRule ^/content/download.*$ <httproot>/ezpublish-xxx/index.php [L]

This will send all download requests to the index.php script so eZ publish can handle the download. This rewrite rule needs to be before the other ones you have. The [L] is used to tell apache that this should be the last rewrite rule, skip the rest if this matches.

--bård

Documentation: http://ez.no/doc

andre müller

Friday 02 May 2003 11:32:24 am

Thanks a lot for your reply, bard. I'm running in nvh environment though..
would the syntax .../demo/content/download/320/1588/image/imagename.jpg be correct? does it at all need the filename at the end?

Marco Zinn

Friday 02 May 2003 1:04:42 pm

Hi,

what is a "downloadable image"?
I used a "file" attribute to upload a GIF file.
The object is at http://ez3.hyperroad-design.com/demo/content/view/full/202/

I can download the GIF with this URL
http://ez3.hyperroad-design.com/demo/content/download/206/617/file/ANIM07.GIF

It works, althoug I expected, that it would not work, because of the rewrite rules. But it looks, like "content/download" already is handled correctly. I use 3.0.1.

BTW:
I found, that I could omit the last or even the last 2 parameters. So, this works, too: http://ez3.hyperroad-design.com/demo/content/download/206/617/

Marco
http://www.hyperroad-design.com