Пример #1
0
        public async Task HandleSelection(IFileListEntry[] files)
        {
            string EndDirectory = "wwwroot/files/";
            var    file         = files.FirstOrDefault();

            if (file != null)
            {
                // Just load into .NET memory to show it can be done
                // Alternatively it could be saved to disk, or parsed in memory, or similar

                /*var ms = new MemoryStream();
                 * await file.Data.CopyToAsync(ms);*/
                using (FileStream DestinationStream = File.Create(EndDirectory + "file.csv"))
                {
                    await file.Data.CopyToAsync(DestinationStream);
                }
                await CsvService.ImportCSV();

                UploadStatus = $"Finished loading {file.Size} bytes from {file.Name}";
            }
        }