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.
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
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.
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.
These classes are internal but are to become public in a future version. Torture!
Hi Ian,
Check out the Restricted Upload datatype that Tim made - should do everything you need: Restricted Upload
-Tom
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.
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
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.
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
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.
is working on a reply...