My given code has an error of type conversion
int imglength = FileUpload2.PostedFile.ContentLength;
byte imgarray=new byte[imglength];
You're trying to assign an array of bytes (byte[]
) to a single byte, hence the error.
Try the following code:
byte[] imgarray = new byte[imglength];
you can not assign a byte array to byte
try this
byte[] bytearray = new byte[imglength];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With