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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 04:23:32
Script start
Timing: Jan 18 2025 04:23:32
Module start 'layout'
Timing: Jan 18 2025 04:23:32
Module start 'content'
Timing: Jan 18 2025 04:23:33
Module end 'content'
Timing: Jan 18 2025 04:23:33
Script end

Main resources:

Total runtime0.8906 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 590.2969152.6094
Module start 'layout' 0.00670.0032 742.906339.4297
Module start 'content' 0.00990.8792 782.3359594.3438
Module end 'content' 0.88910.0015 1,376.679712.1953
Script end 0.8905  1,388.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4130160.0002
Check MTime0.00150.1634160.0001
Mysql Total
Database connection0.00100.109910.0010
Mysqli_queries0.832193.4357620.0134
Looping result0.00060.0626600.0000
Template Total0.855196.020.4276
Template load0.00200.223620.0010
Template processing0.853195.797220.4266
Template load and register function0.00020.024510.0002
states
state_id_array0.00070.083210.0007
state_identifier_array0.00100.106820.0005
Override
Cache load0.00170.1888310.0001
Sytem overhead
Fetch class attribute can translate value0.00060.068630.0002
Fetch class attribute name0.00160.182260.0003
XML
Image XML parsing0.00140.160930.0005
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00140.1521230.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs