We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

[Closed] Add upload file directory above the web root

How Do I?

deswork's avatar
deswork
93 posts
about 4 years ago
deswork's avatar deswork

I’m looking to add a secure upload folder that is outside of the web root.

In the URL and Path Settings I have the setting below:-

Default base URL: http://ee6:8888/

Default base path: /Users/wayne/Sites/localhost

I’ve created a folder in the localhost directory called: ee6-assets and setup a new upload directory with the following settings:-

Upload directory: /Users/wayne/Sites/localhost/ee6-assets/

Upload path: {base_path}/ee6-assets/

When I upload a file it get uploaded to the correct folder but it doesn’t show in the modal window when I click on the filename.

Could someone please let me know where I’m going wrong.

Thanks Wayne.

       
Andy McCormick's avatar
Andy McCormick
183 posts
about 4 years ago
Andy McCormick's avatar Andy McCormick

I don’t think that’s possible to do. It will upload the file because PHP can access that location. However, URL returned for that location will never be accessible to the browser because it’s above web root.

Example:

Folder Structure:

├── public_html
|   ├── admin.php
|   ├── index.php
|   ├── images
│   └── themes
└── system
└── uploads

Here, the webroot is /public_html/ and the uploads folder is above web root ( /uploads ). The URL for the images folder in public_html is domain.com/images , as domain.com points to /public_html. You can not traverse up the folder the tree in a URL, so it’s impossible to access /uploads via the browser (which is why you move items above web root anyways).

👍 1
       
deswork's avatar
deswork
93 posts
about 4 years ago
deswork's avatar deswork

Thanks for explanation Andy.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.