eZ Community » Forums » Setup & design » image download
expandshrink

image download

image download

Friday 02 May 2003 10:23:24 am - 3 replies

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.

Friday 02 May 2003 10: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

Friday 02 May 2003 8:32:24 pm

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?

Friday 02 May 2003 10: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/d...ent/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/

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from