cancel
Showing results for 
Search instead for 
Did you mean: 

Upload Any File Type - Non-Image

Upload Any File Type - Non-Image

Hello, 

 

I'm an Admin user of the Commerce backend rather than a developer, but I'd like to make a kind request for some information that I can pass to my team. 

 

I'm looking to upload a .js file to my Adobe Commerce environment. I just want to host the file, so it can be called to. I appreciate there are other ways to pass HTML code to specific pages, but we want this file to be hosted on our site in this example. 

 

Obviously trying to upload the file in Media Manager throws a compatibility error. I'm looking for something like a File Manager, a place where I can upload any files, like script files, stylesheets, pdfs, etc.  It could be anything, I just want the ability to upload any file to my backend and use it like a normal repository for content. 

 

Is something like this possible?  

 

Regards ,

Mark

 

1 REPLY 1

Re: Upload Any File Type - Non-Image

Ask your developer to upload the .js file to the pub/media/custom/ folder or another subfolder inside the pub directory.
Why pub/media/custom/?
Files under pub/media are publicly accessible via URL, and this area is safe for hosting static assets without deploying code.
Example:
If they upload the file to:
/var/www/html/pub/media/custom/myscript.js
It will be accessible via:
https://www.yoursite.com/media/custom/myscript.js

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.