Copied to clipboard

Flag this post as spam?

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


  • Jeff Chapin 18 posts 39 karma points
    Oct 14, 2011 @ 00:50
    Jeff Chapin
    0

    Media Sub Folders - How to upload to a sub folder?

    How do you load images in a sub folder?
    (Sub folders on the server.)

    For example:
    When I right click on 'images' and click 'Create' I'd expect the image would be uploded to that folder.
     

    Is there a way to do that?

    I can do it in code, (below), So I hope it can be done in the Umbraco browser.

    MediaType MediaOfSomeType = MediaType.GetByAlias("image");
    Media[] m = (Media[])Media.GetMediaOfMediaType(MediaOfSomeType.Id);
    Media newMedia = Media.MakeNew(FileName, MediaOfSomeType, new User(0), ParentNodeID);
    newMedia.getProperty("umbracoFile").Value = "/media/about/images/" + newMedia.Id + "/" + FileName;
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 15, 2011 @ 17:10
    Jan Skovgaard
    0

    Hi Jeff

    Is there any particular reason why you would have it structured like the above screendump on the disk?

    In the media section in Umbraco the structure is going to be like what you show in the dump.

    /Jan

  • Jeff Chapin 18 posts 39 karma points
    Oct 17, 2011 @ 17:34
    Jeff Chapin
    0

    The site has thousands of images and PDFs.
    First I heard the computer is slower when folders have over 1024 items in them.
    Second I find it visually overwhelming to see a folder so full it scrolls for pages giving no clue what's in them. (PDFs Images, DOCs, No clue just a folder number.) 

    Are you saying if I use the media section in Umbraco there's no way to have sub foders?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 17, 2011 @ 17:39
    Jan Skovgaard
    0

    Hi Jeff

    No I'm not saying it's not possible - I suppose you could somehow fix it to act as desired with some custom code...but I would not have a clue on how to do that since I'm a frontend developer :-) - And I think that there probably is a lot of scenarios to think of before doing it.

    But why do you need the access to the physical files? I'm still missing that part...each folder is named with a unique id, which is being used in Umbraco to map them to the files when you're fetching them using XSLT for instance.

    /Jan

  • Jeff Chapin 18 posts 39 karma points
    Oct 17, 2011 @ 18:21
    Jeff Chapin
    0

    Why do I need to access the physical files - the short answer is I don't know.  It just seems crazy to stuff everything in one folder.  Nobody does that.

    The long answer is we are transitioning from a physical file website to a database driven web site.  I wrote a program to import the physical HTML, Images and PDFs into Umbraco.  The import program worked great.  It put the HTML in the database so I don't care where it went and put the images and PDFs in the media section categorized by sub folder the way it found them similar to the structure shown below.

    media
         Department-A
              Images
              PDFs
          Department-B
              Images
              PDFs
         Department-C
              etc.

    It all works great.  I only noticed a problem when we started adding images through Umbraco, it puts them directly under the media folder and I don't like that.

    About your other statement.  I've modified the Umbraco core before and fixed a number of their bugs.  I could fix this bug too but I was hoping there was another way.  I don't like to modify the core because each time they come out with a new version my fixes are lost. 
     

Please Sign in or register to post replies

Write your reply to:

Draft