Share » Forums » Developer » Downloading files from var

Downloading files from var

Downloading files from var

Tuesday 23 March 2010 5:30:42 am - 4 replies

Author Message

Peter Keung

Tuesday 23 March 2010 8:31:49 am

Part of the standard rewrite rule set is:

RewriteRule ^/var/storage/.* - [L]
 RewriteRule ^/var/[^/]+/storage/.* - [L]

This facilitates you placing files to download in the var/storage directory (or in sub-folders of the var/storage directory).

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Bertrand Dunogier

Moderated by: Nicolas Pastorino

Tuesday 23 March 2010 11:51:56 am

Peter's answer will indeed solve the issue, but you should be careful, though, as using this will make any file in var/ available publicly, while they're usually downloaded using the content/download script.

If you have a known pattern for these files, you could limit the rewrite rule:

RewriteRule ^/var/[^/]+/storage/THEFILE\.XXX - [L]

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Kristof Coomans

Tuesday 23 March 2010 1:10:03 pm

Why not changing the rewrite rules suggested in the documentation, to something more secure?

Also see http://ez.no/doc/ez_publish/technical_manual/4_x/installation/virtual_host_setup#comment17679

I'm pretty sure there is an issue about this also in the issue tracker, can't find it back though (might be because I don't see security issues anymore).

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nicolas Pastorino

Wednesday 24 March 2010 4:18:27 am

Why not changing the rewrite rules suggested in the documentation, to something more secure?

Good point yes. Pushing this to engineering.
Thanks Kristof

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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

36 542 Users on board!

Forums menu