In Umbraco, I'm using the Media folder as you would expect for page images but I would also like to have another folder where I can put .pdf and other documents for visitors to download from a /downloads path.
Currently, I have the folder on the web server and I upload files to the /downloads path manually via FTP but it would be great if there was a way I could handle this via Back Office in Umbraco instead of using FTP.
Is this possible and if so, can anyone point me in the right direction?
(This can probobly be made nicer, but it gives you an idea.)
Result:
Hopefully this gives you an idea. Make sure that pdf files are not in the disallowedUploadFiles list in /Config/umbracoSettings.config file.
Also if you want your files URL to look like /downlods/examplefile.txt instead of the standard /media/mediaId/examplefile.txt, this is totally doable. You need to do your own custom UrlProvider and ContentFinder. Luckily there is this great tutorial on how to do this: http://24days.in/umbraco-cms/2014/urlprovider-and-contentfinder/
Manage Downloads Folder via Back Office
Hi all,
In Umbraco, I'm using the Media folder as you would expect for page images but I would also like to have another folder where I can put .pdf and other documents for visitors to download from a /downloads path.
Currently, I have the folder on the web server and I upload files to the /downloads path manually via FTP but it would be great if there was a way I could handle this via Back Office in Umbraco instead of using FTP.
Is this possible and if so, can anyone point me in the right direction?
Hi Richard.
Here is one way of solving this:
Create a folder in your Media section called "Downloads".
Then Create a DocumentType (with a Template) called "Downloads" with a Media Picker property called "Media Folder".
Now create a page called "Downloads" with this new DocumentType in your content area.
Now this page will get the URL /downloads. In your Downloads.cshtml file that you created, paste the following code:
(This can probobly be made nicer, but it gives you an idea.)
Result:
Hopefully this gives you an idea. Make sure that pdf files are not in the disallowedUploadFiles list in /Config/umbracoSettings.config file.
Also if you want your files URL to look like /downlods/examplefile.txt instead of the standard /media/mediaId/examplefile.txt, this is totally doable. You need to do your own custom UrlProvider and ContentFinder. Luckily there is this great tutorial on how to do this: http://24days.in/umbraco-cms/2014/urlprovider-and-contentfinder/
Best of luck to you!!
Hi Richard.
Did you try the above or did you come up with a solution yourself?
Would you like to share your solution so that it might help others?
All the best! / Dennis
is working on a reply...