Image dowload

Author Message

Fabien Mas

Thursday 19 April 2007 1:37:55 am

Hi, I would like to create a link to download different types of files
My download URL is : /content/download/$objectID/$attributeID/file/$original_file_name

It works for pdf, doc,rtf,... files but not with images(jpg,png,..)
What Can I do to get it working ?

Thx, Fabien :)

Egil Fujikawa Nes

Thursday 19 April 2007 2:13:33 am

Hi Fabien,

This can be related to your rewrite rules of Apache. Earlier documentation of Virtual host configuration could be as simple as this:

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|js|asf|avi|wmv|swf|xsl|jar)$ /index.php

As you can see this will not allow jpg or gif files to be accessed trough the download functionality of eZ publish.

The new documentation give a lot more complex RewriteRule:

RewriteEngine On
Rewriterule ^/var/storage/.* - [L]
Rewriterule ^/var/[^/]+/storage/.* - [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
Rewriterule ^/share/icons/.* - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^/favicon\.ico - [L]
RewriteRule ^/robots\.txt - [L]
RewriteRule .* /index.php

It's no longer the file extension but the file location that's relevant for how the file will be handled by Apache.

Hope this can help you to sort out your problem :)

BuildCMS - Av. Paulista 777, 15° Andar - CEP: 01311-100 - São Paulo
URL: http://www.buildcms.com

Fabien Mas

Thursday 19 April 2007 2:23:46 am

It will help for sure,

thx :)

Fabien Mas

Thursday 19 April 2007 6:06:43 am

Actually, it was my entire fault, I made a mistake to set the attributeIDwith images (not with files) ...

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 19:35:39
Script start
Timing: Jan 18 2025 19:35:39
Module start 'layout'
Timing: Jan 18 2025 19:35:39
Module start 'content'
Timing: Jan 18 2025 19:35:39
Module end 'content'
Timing: Jan 18 2025 19:35:39
Script end

Main resources:

Total runtime0.7461 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.9219152.6094
Module start 'layout' 0.00510.0024 741.531339.3984
Module start 'content' 0.00750.7372 780.9297542.4922
Module end 'content' 0.74470.0014 1,323.421912.2031
Script end 0.7461  1,335.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4294160.0002
Check MTime0.00130.1706160.0001
Mysql Total
Database connection0.00080.101310.0008
Mysqli_queries0.699193.7053600.0117
Looping result0.00050.0669580.0000
Template Total0.719796.520.3598
Template load0.00210.282120.0011
Template processing0.717696.178420.3588
Template load and register function0.00020.023210.0002
states
state_id_array0.00090.122810.0009
state_identifier_array0.00090.124420.0005
Override
Cache load0.00170.2303230.0001
Sytem overhead
Fetch class attribute can translate value0.00050.068120.0003
Fetch class attribute name0.00100.129850.0002
XML
Image XML parsing0.00070.091120.0003
class_abstraction
Instantiating content class attribute0.00000.001650.0000
General
dbfile0.00070.0984160.0000
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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs