Beispiel #1
0
        public async Task <IActionResult> DownloadAlbum([FromBody] DownloadAlbum request)
        {
            IEnumerable <PhotoAlbumDTO> photos = await _albumsService.GetAlbumPhotos(request.AlbumId);

            IEnumerable <System.Guid> photoIds = photos.Select(p => p.PhotoId);

            System.IO.Stream fileStream = await _photosService.DownloadPhotosAsync(photoIds);

            return(File(fileStream, contentType: "application/vnd.rar", fileDownloadName: "Album.rar"));
        }
 public Task <Stream> DownloadPhotosAsync(IEnumerable <Guid> photosToDownloadIds)
 {
     return(_photosService.DownloadPhotosAsync(photosToDownloadIds));
 }