Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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
                });
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }