1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 00:45:18 +00:00

Create destination folder

This commit is contained in:
2020-06-22 08:24:12 +02:00
parent 23da151635
commit 368a512722
2 changed files with 36 additions and 1 deletions

View File

@ -15,6 +15,7 @@ use crate::data::error::{ExecError, ResultBoxError};
use crate::data::user::UserID;
use crate::helpers::{account_helper, api_helper, conversations_helper, user_helper};
use crate::utils::virtual_directories_utils::check_virtual_directory;
use crate::utils::user_data_utils::prepare_file_creation;
/// Http request handler
///
@ -278,7 +279,9 @@ impl HttpRequestHandler {
pub fn save_post_image(&mut self, name: &str, folder: &str, max_w: u32, max_h: u32) -> ResultBoxError<String> {
let file = self.post_file(name)?;
Ok(format!("f {} size: {}", file.name, file.buff.len()))
let target_user_data_folder = prepare_file_creation(self.user_id()?, folder)?;
Ok(target_user_data_folder.to_str().unwrap().to_string())
}
/// Get an integer included in the POST request