Hi, firstly sorry if this is the wrong place to post this question. I was going to put it in issues.umbraco as feature request but wasn't sure if it was the correct place.
I'm using Umbraco 7.1.0. I want to be able to create Media from my business logic layer. I've added a reference to Umbraco.Core that gives me access to IMediaService what is then passed in from the web project. Using this interface I can now create Media. Problem comes when I try to set the "umbracoFile" property since it requires a "HttpPostedFileBase" to do all the helpful things like creating a file for me. This is a problem for me since "ideally" I do not want to add a reference to System.Web within my logic layer.
Currently to work around this I've inherited HttpPostedFileBase and just setting the properties from the constructor and passing a FileStream directly into the class.
Having scanned though your source code it looks like it shouldn't be to hard to add another overload in "ContentBase.SetPropertyValue" for some kind of media model that would include the Stream and file name ect (basically the same as the HttpPostedFileBase class).
Would this be useful to anyone else? I would be happy to implement the feature but wanted your input before making any actual changes.
Removing HttpPostedFileBase dependency
Hi, firstly sorry if this is the wrong place to post this question. I was going to put it in issues.umbraco as feature request but wasn't sure if it was the correct place.
I'm using Umbraco 7.1.0. I want to be able to create Media from my business logic layer. I've added a reference to Umbraco.Core that gives me access to IMediaService what is then passed in from the web project. Using this interface I can now create Media. Problem comes when I try to set the "umbracoFile" property since it requires a "HttpPostedFileBase" to do all the helpful things like creating a file for me. This is a problem for me since "ideally" I do not want to add a reference to System.Web within my logic layer.
Currently to work around this I've inherited HttpPostedFileBase and just setting the properties from the constructor and passing a FileStream directly into the class.
Having scanned though your source code it looks like it shouldn't be to hard to add another overload in "ContentBase.SetPropertyValue" for some kind of media model that would include the Stream and file name ect (basically the same as the HttpPostedFileBase class).
Would this be useful to anyone else? I would be happy to implement the feature but wanted your input before making any actual changes.
is working on a reply...