2014-03-25 2 views

답변

0
var stream = Request.Files["hiddenUploadButton"].InputStream; 

this link을 참조하십시오.

아마 this과 같은 것을하고 싶습니까?

스트림으로 변환하는 방법
0
if you want to save file try following code snippet 

HttpPostedFile file = Request.Files["myFile"]; 

    //check file was submitted 
    if (file != null && file.ContentLength > 0) 
    { 
     string fname = Path.GetFileName(file.FileName); 
     file.SaveAs(Server.MapPath(Path.Combine("~/App_Data/", fname))); 
    } 

,

 HttpPostedFile file = Request.Files["myFile"]; 
var FileLen = file .ContentLength; 
    byte[] input = new byte[FileLen]; 
    System.IO.Stream MyStream; 
    // Initialize the stream. 
    MyStream = file .InputStream; 

    // Read the file into the byte array. 
    MyStream.Read(input, 0, FileLen); 
관련 문제