Forums / Setup & design / Binary file storage locations
James Robertson
Wednesday 17 May 2006 3:06:43 pm
What is the difference between the various locations in which binary files are stored (in the filesystem)?
For example: design/standard/templates/content/datatype/view/ezbinaryfile.tpl uses an ugly looking concat() statement to build a file path like this:http://example.com/content/download/2763/31387/version/3/file/ENUtxt.pdf
whereas design/standard/templates/content/datatype/view/ezbinaryfile_direct.tpl uses $attribute.content.filepath property, which contains a filepath like this:http://example.com/var/biotech/storage/original/application/427211c95c56412fe1da1671af5f40fc.pdf
What's the difference (apart from the fact that the second example is clearer to achieve but look uglier)?
Also, Is the second example version controlled (ie. will $attribute.content.filepath always point to the latest version of the file)?
Why are the files (apparently) stored twice?
Bruce Morrison
Wednesday 17 May 2006 4:35:37 pm
Hi James
The first example is a passthrough and will utilise eZ access checking etc, ensuring that the user accesing the file has the correct permissions to view the file (based on access to the parent object).
The second example will be a direct link to the file.
The file is stored once.
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
Thursday 18 May 2006 3:17:22 pm
Thanks Bruce. [Looking at this again, I should have been able to work this out myself. Must have been a bad day ;-]
Wouldn't it be nice to have the 'passthrough' URL available as a property of the binary_file attribute, just like the filepath (ie. 'direct link'), instead of having to create it using that horrible concat() statment (with all those naughty hard-coded partial path names). Were do I apply to make this happen?