Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Teis Draiby 3 posts 23 karma points
    Jun 29, 2010 @ 02:45
    Teis Draiby
    0

    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

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jun 29, 2010 @ 05:35
    Aaron Powell
    0

    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.

  • Teis Draiby 3 posts 23 karma points
    Jun 29, 2010 @ 15:16
    Teis Draiby
    0

    Thanks for keywords and pointing me in the right direction!

  • Teis Draiby 3 posts 23 karma points
    Jun 29, 2010 @ 20:54
    Teis Draiby
    0

    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)

     

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Feb 29, 2012 @ 18:56
    Alex Skrypnyk
    0

    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

  • 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.

Please Sign in or register to post replies