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
Post a Comment