When I try to save a video in Sql server, i'm facing to this kind of error bellow: The request filtering module is configured to deny a request that exceeds the request content length.
//Converting a file Uploaded in byte before inserting it in DB.
using (BinaryReader br = new BinaryReader(fs))
{
byte[] bytes = br.ReadBytes((Int32)fs.Length);
string constr = (@"Data Source=(localdb)\MSSQLLocalDB;....");
using (SqlConnection con = new SqlConnection(constr))
{
string query = "insert into tblFiles values (@Name, @ContentType, @Data)";
using (SqlCommand cmd = new SqlCommand(query))
{
//// ????
}
}
}
//The Kind of table i'm Using in Sql_Server
CREATE TABLE tblFiles(Id int IDENTITY PRIMARY KEY,Name
VARCHAR(100) NOT NULL,
ContentType NVARCHAR(4000)NOT NULL, Data VARBINARY(MAX)NOT
NULL);