Forums / Setup & design / Problem with direct linking to a binary file

Problem with direct linking to a binary file

Author Message

Maarten Holland

Tuesday 28 September 2004 11:48:47 pm

Hi all,

Can anyone tell me if it is possible to link directly to a binary file from one of my template overrides? I get an URL like http://mysite.com:2075/index.php/content/download/167/487/file/myuploadedfile.pdf but that only works from the admin interface. When I change the port to my user access, it says 'Object not available'.

After this, I have another problem: I tried to show which templates are being used in the admin interface, so I can see what code they use. To do this, I've added the following to site.ini.append.php:

[ContentSettings]
TranslationList=
ViewCaching=disabled

[TemplateSettings]
Templatecache=disabled
Templatecaching=disabled
AutoloadPath=lib/eztemplate/classes/;kernel/common/
Debug=enabled
NodeTreeCaching=disabled
ProcessCaching=disabled

[OverrideSettings]
Cache=disabled

[DebugSetttings]
DebugByIP=disabled
Debug=inline
DebugRedirection=disabled

After which I see the templatenames, but when I try to open any page in the content part of the admin interface, I get an error or just the page without my content.

Does anyone know how I can solve these 2 problems?

Thank you for your help,

Maarten

Nicolas Heiringhoff

Wednesday 29 September 2004 1:21:21 am

Hello Maarten,

we use this code to link directly to an pdf file, that can be uploaded with an article.
I do not know if you try to this, or if your binary file is some kind of static.
Maybe the code helps.



{* Fetch everything that is under node #296 (children, grand-children, etc.) *}
{let nodes=fetch( 'content', 'tree', hash( 'parent_node_id', 296 ) ) }

{* Loop through the nodes and display their names. *}
{section loop=$nodes}


<br />

{$:item.data_map.titel.data_text}

<br />

{$:item.data_map.beschreibung.data_text}

<br />

<a href={concat("content/download/",
$:item.object.id,
"/",
$:item.object.data_map.file.id,
"/file/",
$:item.object.data_map.file.content.original_filename)|ezurl}>
{$:item.object.name|wash}</a>

<br />
{/section}



{/let}

 

Nico

http://www.heiringhoff.de

paul bolger

Wednesday 25 April 2007 7:40:00 pm

Not sure about the $:variable stuff - but I've only been around eZ for the past eight months or so. Here's what worked for me in 3.86:

<a href={concat

("content/download/",
$related.main_node.object.id,
"/",
$related.main_node.data_map.file.id,
"/file/",
$related.main_node.data_map.file.content.original_filename
)
|ezurl}>

{$related.main_node.name|wash}
 {'application/pdf'|mimetype_icon( small, "Download PDF"|i18n( "design/base" ) )}</a> (pdf file)

Adding a filesize would be cute - later!

Paul Bolger

eZ debug

Timing: Jan 31 2025 04:34:51
Script start
Timing: Jan 31 2025 04:34:51
Module start 'content'
Timing: Jan 31 2025 04:34:51
Module end 'content'
Timing: Jan 31 2025 04:34:51
Script end

Main resources:

Total runtime0.1624 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 588.0625180.8125
Module start 'content' 0.00850.0065 768.875098.0547
Module end 'content' 0.01510.1473 866.9297528.3750
Script end 0.1624  1,395.3047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.2028200.0002
Check MTime0.00140.8633200.0001
Mysql Total
Database connection0.00150.940810.0015
Mysqli_queries0.115070.79521410.0008
Looping result0.00120.72751390.0000
Template Total0.146890.410.1468
Template load0.00090.569610.0009
Template processing0.145989.804710.1459
Override
Cache load0.00060.370110.0006
Sytem overhead
Fetch class attribute can translate value0.00090.559710.0009
XML
Image XML parsing0.00020.137310.0002
General
dbfile0.00643.9390200.0003
String conversion0.00000.004430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs