From be81eaefa526fa80e04166e86978e3a95263b4e3 Mon Sep 17 00:00:00 2001 From: Alec Di Vito Date: Thu, 6 Jun 2024 18:42:20 -0400 Subject: feat: Added HTML and Javascript progress bar when uploading files --- src/errors.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 21f8f12..600834b 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -129,6 +129,7 @@ where let res = fut.await?.map_into_boxed_body(); if (res.status().is_client_error() || res.status().is_server_error()) + && res.request().path() != "/upload" && res .headers() .get(header::CONTENT_TYPE) -- cgit v1.2.3 From 413a63a60307bdf60229670b0f858963604d62a3 Mon Sep 17 00:00:00 2001 From: Alec Di Vito Date: Sun, 16 Feb 2025 23:35:26 -0500 Subject: feat: implement temporary file uploads and tweak mobile design --- src/errors.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index f0e22ab..24997fc 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -43,6 +43,10 @@ pub enum RuntimeError { #[error("File already exists, and the overwrite_files option has not been set")] DuplicateFileError, + /// Uploaded hash not correct + #[error("File hash that was provided did not match end result of uploaded file")] + UploadHashMismatchError, + /// Upload not allowed #[error("Upload not allowed to this directory")] UploadForbiddenError, @@ -86,6 +90,7 @@ impl ResponseError for RuntimeError { use StatusCode as S; match self { E::IoError(_, _) => S::INTERNAL_SERVER_ERROR, + E::UploadHashMismatchError => S::BAD_REQUEST, E::MultipartError(_) => S::BAD_REQUEST, E::DuplicateFileError => S::CONFLICT, E::UploadForbiddenError => S::FORBIDDEN, -- cgit v1.2.3 From 577044ddbd70f5f128512c1a021329fb4c7e7eb3 Mon Sep 17 00:00:00 2001 From: Alec Di Vito Date: Sat, 22 Feb 2025 13:44:16 -0500 Subject: feat: address comments; add in new argument (`temp-directory`); add comments to upload code; add tests --- src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 24997fc..b7d75f2 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -44,7 +44,7 @@ pub enum RuntimeError { DuplicateFileError, /// Uploaded hash not correct - #[error("File hash that was provided did not match end result of uploaded file")] + #[error("File hash that was provided did not match checksum of uploaded file")] UploadHashMismatchError, /// Upload not allowed -- cgit v1.2.3