|
|
|
@ -37,8 +37,7 @@ pub async fn download(
|
|
|
|
|
) -> Result<HttpResponse, Error> {
|
|
|
|
|
let id = req.match_info().query("id");
|
|
|
|
|
let (file_id, file_name, valid_till, content_type, delete) = load_file_info(id, &db).await?;
|
|
|
|
|
let mut path = config.files_dir.clone();
|
|
|
|
|
path.push(&file_id);
|
|
|
|
|
let path = config.files_dir.join(&file_id);
|
|
|
|
|
|
|
|
|
|
let mime = Mime::from_str(&content_type).unwrap_or(APPLICATION_OCTET_STREAM);
|
|
|
|
|
let mut response = match get_view_type(&req, &mime, &path, delete).await {
|
|
|
|
|