System.byte error while reading a pdf file in C# -


i have tried every possible solution given on website.

private byte[] getbinaryfile() {     stream fs = fileupload1.postedfile.inputstream;     binaryreader br = new binaryreader(fs);     byte[] bytes = br.readbytes((int32)fs.length);     return bytes; } 

this trying read fileuploader didn't work. changed idea uploaded file on server first , trying read again gave me same error of system.byte(). thing not return byte format of pdf worked on local system has server? appreciated

you can try this:-

byte[] bytes = new byte[fileupload1.postedfile.contentlength]; bytes = fileupload1.filebytes; 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -