In order to keep the website organization clear and mantain the structure from the previous website I'd like to upload files to a specific directory. How is that possible? Using the "Upload" data type there are no options for the upload location.
Ideally I'd also like to check for existing files having the same filename and add a number to the uploaded file to avoid overwriting.
I am fairly new to Umbraco and ASP.NET in general, so I hope the question make any sense.
The built in media controls do not support setting a different folder. The best way to achieve what you want is to use the events of the Media type, the AfterSave event is probably the best one to go with. You can then move the uploaded file to where ever you want.
You'll then need to update the file path stored otherwise you'll not be able to find it again. There's a few other questions similar to this on the forum if you do a search.
Upload to custom folder
Hi Wiz's
In order to keep the website organization clear and mantain the structure from the previous website I'd like to upload files to a specific directory. How is that possible? Using the "Upload" data type there are no options for the upload location.
Ideally I'd also like to check for existing files having the same filename and add a number to the uploaded file to avoid overwriting.
I am fairly new to Umbraco and ASP.NET in general, so I hope the question make any sense.
Best Teis
The built in media controls do not support setting a different folder. The best way to achieve what you want is to use the events of the Media type, the AfterSave event is probably the best one to go with. You can then move the uploaded file to where ever you want.
You'll then need to update the file path stored otherwise you'll not be able to find it again. There's a few other questions similar to this on the forum if you do a search.
Thanks for keywords and pointing me in the right direction!
Found this video on the topic, along with sample code:
http://umbraco.org/documentation/videos/for-developers/events/friendly-media-item-paths
(The video cuts off too early)
Hi everyone,
We need to create folder with files which will not be available to unauthorized users direct Url
Example:
http://test.com/media/4006/secretariat.jpg
How do that ?
Create custom secure folder, into with upload files ?
Thanks,
Alex
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.