update file upload 3
This commit is contained in:
@@ -7,6 +7,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -28,6 +30,8 @@ public class FileService {
|
|||||||
|
|
||||||
private static final String UPLOAD_DIR = "C:\\mnt\\hermione_storage\\documents\\file_input_scenarios\\";
|
private static final String UPLOAD_DIR = "C:\\mnt\\hermione_storage\\documents\\file_input_scenarios\\";
|
||||||
|
|
||||||
|
private Logger logger = LoggerFactory.getLogger(FileService.class);
|
||||||
|
|
||||||
@Value("${file.upload-dir}")
|
@Value("${file.upload-dir}")
|
||||||
private String uploadDir;
|
private String uploadDir;
|
||||||
|
|
||||||
@@ -38,6 +42,8 @@ public class FileService {
|
|||||||
folder.mkdirs(); // Crea la cartella se non esiste
|
folder.mkdirs(); // Crea la cartella se non esiste
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info("path folder:", folder.getAbsolutePath().toString());
|
||||||
|
|
||||||
File emailFolder = new File(folder, "email");
|
File emailFolder = new File(folder, "email");
|
||||||
|
|
||||||
if (!emailFolder.exists()) {
|
if (!emailFolder.exists()) {
|
||||||
@@ -82,6 +88,7 @@ public class FileService {
|
|||||||
return ResponseEntity.ok(folderName);
|
return ResponseEntity.ok(folderName);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
logger.error("Error uploading files: {}", e.getMessage());
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||||
.body("Error uploading files: " + e.getMessage());
|
.body("Error uploading files: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ spring.ai.vectorstore.chroma.client.port=8000
|
|||||||
spring.ai.vectorstore.chroma.client.key-token=tKAJfN1Yv5lP7pKorJHGfHMQhNEcM9uu
|
spring.ai.vectorstore.chroma.client.key-token=tKAJfN1Yv5lP7pKorJHGfHMQhNEcM9uu
|
||||||
spring.ai.vectorstore.chroma.initialize-schema=true
|
spring.ai.vectorstore.chroma.initialize-schema=true
|
||||||
spring.ai.vectorstore.chroma.collection-name=olympus
|
spring.ai.vectorstore.chroma.collection-name=olympus
|
||||||
file.upload-dir=mnt/hermione_storage/documents/file_input_scenarios/
|
file.upload-dir=/mnt/hermione_storage/documents/file_input_scenarios/
|
||||||
|
|
||||||
spring.servlet.multipart.max-file-size=10MB
|
spring.servlet.multipart.max-file-size=10MB
|
||||||
spring.servlet.multipart.max-request-size=10MB
|
spring.servlet.multipart.max-request-size=10MB
|
||||||
|
|||||||
Reference in New Issue
Block a user