This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Downloading files from var
expandshrink

Downloading files from var

Downloading files from var

Tuesday 23 March 2010 1:30:42 pm - 4 replies

I have a file at /var (tryed with files of type .txt .pdf .csv)

When I try to Get that file (I supose it will try to download it) via www.mysite.com/var/THEFILE.XXX it comes up with the

Module Not found

How can I get files from the var directory?

Tuesday 23 March 2010 4:31:49 pm

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).

Tuesday 23 March 2010 7:51:56 pm

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]

Modified on Wednesday 24 March 2010 12:17:25 pm by Nicolas Pastorino

Tuesday 23 March 2010 9: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/techn...tion/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).

Wednesday 24 March 2010 12:18:27 pm

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

Good point yes. Pushing this to engineering.
Thanks Kristof

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from