protected void Button1_Click(object sender, EventArgs e) { UpLoadService.UpLoadServiceClient ser = new UpLoadWebApplication.UpLoadService.UpLoadServiceClient(); UpLoadService.FileUploadMessage request = new UpLoadService.FileUploadMessage(); request.FileName = FileUpload1.FileName; request.FileData = FileUpload1.FileContent; UpLoadService.IUpLoadService channel = ser.ChannelFactory.CreateChannel(); UpLoadService.UploadResult result = channel.UploadFile(request); Response.Write(result.Result.ToString()); }
protected void Button1_Click(object sender, EventArgs e) { UpLoadService.UpLoadServiceClient ser = new UpLoadWebApplication.UpLoadService.UpLoadServiceClient(); //System.IO.Stream stream = FileUpload1.PostedFile.InputStream; //ser.UploadFile(FileUpload1.PostedFile.FileName, "pppp", stream); UpLoadService.FileUploadMessage request = new UpLoadService.FileUploadMessage(); request.FileName = FileUpload1.FileName; request.SavePath = "ooooooo"; request.FileData = FileUpload1.FileContent; UpLoadService.IUpLoadService channel = ser.ChannelFactory.CreateChannel(); channel.UploadFile(request); }
protected void Button1_Click(object sender, EventArgs e) { UpLoadService.UpLoadServiceClient ser = new UpLoadWebApplication.UpLoadService.UpLoadServiceClient(); //System.IO.Stream stream = FileUpload1.PostedFile.InputStream; //ser.UploadFile(FileUpload1.PostedFile.FileName, "pppp", stream); UpLoadService.FileUploadMessage request = new UpLoadService.FileUploadMessage(); request.FileName = FileUpload1.FileName; request.SavePath = "ooooooo"; request.FileData = FileUpload1.FileContent; UpLoadService.IUpLoadService channel = ser.ChannelFactory.CreateChannel(); channel.UploadFile(request); }
public void ProcessRequest(HttpContext context) { if (context.Request.Files.Count > 0) { UpLoadService.UpLoadServiceClient ser = new UpLoadWebApplication.UpLoadService.UpLoadServiceClient(); UpLoadService.FileUploadMessage request = new UpLoadService.FileUploadMessage(); Stream stream = context.Request.Files[0].InputStream; request.FileData = stream; request.FileName = context.Request.Files[0].FileName; UpLoadService.IUpLoadService channel = ser.ChannelFactory.CreateChannel(); UpLoadService.UploadResult result = channel.UploadFile(request); if (result.Result) { context.Response.Write("ok"); } } }