public IActionResult DownloadFile(Guid id)
        {
            BackblazeAPI api = new BackblazeAPI();

            api.AutorizeAccount();
            FileDescription fileDescription = _fileDescriptionsRepository.GetFile(id);

            byte[] filebytes = api.DownloadFileById(fileDescription.BackblazeFileId);
            return(File(filebytes, "application/pdf", fileDescription.FileName + fileDescription.Ext)); //fileDescription.ContentType
        }
Exemple #2
0
        public List <Tuple <FileDescription, string, Guid> > GetCarFiles(Guid id)
        {
            List <CarFile> carFiles = _carFilesRepository.GetCarFiles(id);
            List <Tuple <FileDescription, string, Guid> > files = new List <Tuple <FileDescription, string, Guid> >();

            foreach (var item in carFiles)
            {
                files.Add(Tuple.Create(_fileDescriptionsRepository.GetFile(item.FileDescriptionId), "", Guid.Empty));
            }
            //tak samo trzeba dodać dla serwisu, szkody i wydatku złożyć w jedną listę i oddać do metody
            return(files);
        }