@ -1,6 +1,7 @@
use std ::path ::Path ;
use std ::path ::Path ;
use chrono ::{ DateTime , Duration , Utc } ;
use chrono ::{ DateTime , Duration , Utc } ;
use futures ::TryFutureExt ;
use rocket ::form ::Form ;
use rocket ::form ::Form ;
use rocket ::fs ::NamedFile ;
use rocket ::fs ::NamedFile ;
use rocket ::fs ::TempFile ;
use rocket ::fs ::TempFile ;
@ -226,11 +227,9 @@ async fn post_send_file(data: Form<UploadData<'_>>, headers: Headers, conn: DbCo
let file_path = folder_path . join ( & file_id ) ;
let file_path = folder_path . join ( & file_id ) ;
tokio ::fs ::create_dir_all ( & folder_path ) . await ? ;
tokio ::fs ::create_dir_all ( & folder_path ) . await ? ;
if CONFIG . uploads_use_copy ( ) {
data . persist_to ( & file_path )
data . move_copy_to ( & file_path ) . await ? ;
. unwrap_or_else ( data . move_copy_to ( & file_path ) )
} else {
. await ? ;
data . persist_to ( & file_path ) . await ? ;
}
let mut data_value : Value = serde_json ::from_str ( & send . data ) ? ;
let mut data_value : Value = serde_json ::from_str ( & send . data ) ? ;
if let Some ( o ) = data_value . as_object_mut ( ) {
if let Some ( o ) = data_value . as_object_mut ( ) {