Search code examples
cssasp.net-mvc-4c#-4.0kendo-uihttppostedfilebase

String To HttpPostedFilebase


I have Kendo ThemeBuilder, Creating a theme from that in MVC C# for that i have a model which contains css body which was return from the themebuilder To save it to the css file i have easily manage it to the folder by creating its CSS file, But i have to store CSS file inside the database by converting it into the binary file.

Now I got problem when i want to read css from the model & directly convert it into the HttpPostedFilebase. So is it possible or any way to direct convert it through the string to HttpPostedFileBase.


Solution

  • There are no need to convert it to the HttpPostedFileBase. By applying direct string of CSS file name inside the path you are able to use that as saved CSS inside the Database. you need to just create method for fetching binary of CSS file from DB & convert it to the String. after that it will same works as CSS file you applied in path.