-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support to specify file upload dir in system configuration #4079
Added support to specify file upload dir in system configuration #4079
Conversation
@eneiasramos - I need more details about this PR. I have some time to test it. |
@addison74 my dear The routine here allows a file to be uploaded to a folder different from media. The idea is to allow the upload of a file, but not to expose the file to the internet (like the media folder does). A use of case: I use the var folder to store PFX certificates used to communicate with a third party system: <upload_dir allowed_extensions="pfx" config="system/filesystem/var" scope_info="1">brazil/cert</upload_dir> |
Review Notes: <filename translate="label" module="brazil">
<label>Filename</label>
<frontend_type>file</frontend_type>
<backend_model>adminhtml/system_config_backend_file</backend_model>
<upload_dir allowed_extensions="pfx" config="system/filesystem/var" scope_info="1">brazil/cert</upload_dir>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends><type_id>1</type_id></depends>
</filename> In the above example, the magento-lts/app/etc/config.xml Lines 114 to 132 in ced031d
Based on the above, the config path is Before this PR, regardless of the attribute For the actual setting of the path, see magento-lts/app/code/core/Mage/Core/Model/Config/Options.php Lines 45 to 60 in ced031d
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved based on testing protected function _getUploadRoot($token)
.
@kiatng thank you my dear! |
I've modified the PR slightly because if you'd use
it would generate a null parameter warning. tested quite some cases and it seems to work correctly now |
@fballiano perfect! |
I'll merge it in a couple of days just to see if we get some more feedback, thank you @eneiasramos |
@fballiano thank you! |
Added support to specify filesystem's directory in file upload ...