Copied to clipboard

Flag this post as spam?

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


  • Ian 32 posts 82 karma points
    Jan 30, 2013 @ 15:45
    Ian
    0

    Limit file upload type and file size in admin area

    There're a few people asking about this but I haven't seen a satisfactory answer. I want the UI to be able to tell the user that a file type is of the wrong type and that it is too big.

    The solutions I've seen for this involve creating a brand new user control but then the logic seems lacking compared to the official version.

    How would I go about creating a new version of the built in upload control derived from the source code? The first issue I've got is that VS has no idea where to find the MediaFileSystem or FileSystemProviderManager classes.

  • Ian 32 posts 82 karma points
    Jan 30, 2013 @ 16:29
    Ian
    0

    These classes are internal but are to become public in a future version. Torture!

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 30, 2013 @ 17:04
    Tom Fulton
    0

    Hi Ian,

    Check out the Restricted Upload datatype that Tim made - should do everything you need:  Restricted Upload

    -Tom

  • Ian 32 posts 82 karma points
    Jan 30, 2013 @ 17:10
    Ian
    0

    Yes it looks nice. Except it doesn't display thumbnails, doesn't delete the files from the disk and the validation doesn't work on IE 9.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jan 30, 2013 @ 17:16
    Tom Fulton
    0

    Ah, didn't realize that - good find.  I'm guessing this is what you're referring to about the classes becoming public, at least the good news is they'll be in the next version.

    In the meantime, not sure if its worth having a look a the source for Restricted Upload to see if it can be updated

  • Ian 32 posts 82 karma points
    Jan 30, 2013 @ 17:23
    Ian
    0

    Yes that's right.

    My plan is to translate as best I can the source code from the official version into calls to the Api and put it inside a usercontrol wrapper.

  • Ian 32 posts 82 karma points
    Jan 30, 2013 @ 17:49
    Ian
    0

    Hmmm... the source code for uploadField is strange. I can't see where it saves the file. Any ideas?

    http://umbraco.codeplex.com/SourceControl/changeset/view/a94f28d74a53#src/umbraco.editorControls/uploadfield/uploadField.cs

  • Ian 32 posts 82 karma points
    Feb 01, 2013 @ 14:50
    Ian
    0

    I've discovered that even the standard Umbraco upload doesn't delete media items from the file system if one deletes the whole media item or replaces the image. It only does it when one explicitly checks the 'Remove file' check box.

Please Sign in or register to post replies

Write your reply to:

Draft