dimanche 10 mai 2015

C# Request.InputStream result my code no response? what is wrong

using (FileStream outputStream = new FileStream (path, FileMode.Create)) 
{
    Stream inputStream = Request.InputStream;
    const int bufferSize = 4096;
    int len;
    byte[] buffer = new byte[bufferSize];
    while ( (len = inputStream.Read(buffer, 0, bufferSize)) > 0)
        {
             outputStream.Write(buffer, 0, len);
        }  
}

My program is running with ASP.Net MVC 5

This is my code, my question is:

when i debug this code, i add a breakpoint in the line "Stream inputStream = Request.InputStream;"

but nothing shows, no error, just cannot run to the next line, it is really weird, i don't know how why, can somebody help me?

Aucun commentaire:

Enregistrer un commentaire