saving images from http request RRS feed

  • Question

  • User1024191908 posted

    I have a generic http handler that receives an image posted from KENDO UI editor.

    inside the handler I try to save the file:

                byte[] buffer = context.Request.BinaryRead(context.Request.TotalBytes);
                FileStream fs = new FileStream(newFileName, FileMode.Create);
                fs.Write(buffer, 0, buffer.Length);

    but the file that is saved is not an image anymore (it was a jpg) and the file is slightly smaller.

    can anyone help please?

    thanks in advance.

    Tuesday, May 1, 2018 12:58 PM

All replies