c# - String or binary data would be truncated when uploading file in MVC -


the file 14kb (14,000 bytes). have read varbinary(max) column type (which using) supports 8,000 bytes. correct? how can upload file database?

if (file.contentlength < (3 * 1048576)) {     // extract fielname     var filename = path.getfilename(file.filename);      using (memorystream ms = new memorystream())     {         file.inputstream.copyto(ms);         byte[] array = ms.getbuffer();         adj.resumefile = array;         adj.resumefilecontenttype = file.contenttype;     } } 

the error:

string or binary data truncated. statement has been terminated.

check other columns inserting during process. check contenttype column image/jpeg , not image or jpeg.

here list of possible content types can create enough space in contenttype column accordingly.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -