jens_vdp
jens_vdp

Reputation: 594

Symfony access assets folder

I have some folders in www/web/ which is the root. It's the following folder: assets/exports/ And it contains a file export.xsl

When I do in javascript:

window.open('/assets/exports/export.xsl');

I'm going to the following link: http://mywebsite/assets/exports/export.xsl

But I get a: 404 not found

Is symfony somehow protecting this link? So, my question is, how can I access this file, so it starts downloading for the visitor?

Upvotes: 0

Views: 691

Answers (1)

takeit
takeit

Reputation: 4081

From Symfony Documentation:

Keep in mind that web/ is a public directory and that anything stored here will be publicly accessible, including all the original asset files (e.g. Sass, LESS and CoffeeScript files).

Make sure you put the files in a proper directory: <symfony_root_dir>/web. See below.

enter image description here

Then accessing the http://mywebsite/assets/exports/export.xsl returns the file's content.

Check also your server configuration, virtual host config and read web server configuration guide from Symfony to see if you configured it properly.

Upvotes: 1

Related Questions