public void ProcessFile() { var fileUploader = new LargeFileUpload(DroppedFile.Name, DroppedFileStream); fileUploader.UploadProgressCompleted += OnUploadProgressCompleted; fileUploader.UploadProgressChanged += OnUploadProgressChanged; fileUploader.UploadAddress = string.Format("{0}?filename={1}", App.Params.FileUploaderUrl, DroppedFile.Name); FileUploaders.Add(fileUploader); fileUploader.UploadFile(); }
private void UploadFiles(string fileName, Stream fileStream) { if (fileStream != null) { var uploadAddress = string.Format("{0}?filename={1}", App.Params.FileUploaderUrl, fileName); var fileUploader = new LargeFileUpload(fileName, fileStream); fileUploader.UploadProgressCompleted += OnUploadCompleted; fileUploader.UploadAddress = uploadAddress; fileUploader.UploadProgressChanged += OnUploadProgressChanged; FileUploaders.Add(fileUploader); fileUploader.UploadFile(); } }
private void OnUploadCompleted(object sender, EventArgs e) { LargeFileUpload fileUploader = sender as LargeFileUpload; if (fileUploader != null) { FileUploaders.Remove(fileUploader); fileUploader.FileStream.Close(); fileUploader.FileStream.Dispose(); OnProgressCompleted(sender, new FileProcessorCompletedEventArgs { NeedRefresh = true }); } }