I have this MVC3 Application where I generate a file within ~/Content/Resource directory, so I need to upload it to database if user picks that option. I have all rest of the logic ready. Just unsure how to approach this.
I have byte[] field in my model ready for it, and have a generated file ready for upload just no idea how to pass the file from server to SQL server… Kinda confused since this won’t be a PostedFIle so dunno how to treat it…
I’ve managed to come up with a simple solution. Just converted generated file to
byte[]and it worked spot on.This is the code
And it worked.