add ocr pipeline
This commit is contained in:
@@ -85,6 +85,13 @@ func FilesUpload(c *gin.Context) {
|
||||
}
|
||||
userID := c.GetString(UserIDKey)
|
||||
folderID := c.PostForm("folderId")
|
||||
// resourceId optionnel : cible un fichier déjà connu (metadata-only de
|
||||
// l'outbox) pour lui attacher ses octets physiques (ex. OCR serveur).
|
||||
resourceID := c.PostForm("resourceId")
|
||||
if resourceID != "" && !deviceIDPattern.MatchString(resourceID) {
|
||||
api.Error(c, http.StatusNotFound, "NOT_FOUND", "file not found")
|
||||
return
|
||||
}
|
||||
|
||||
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, Store.MaxFileSize+1)
|
||||
file, err := c.FormFile("file")
|
||||
@@ -102,7 +109,7 @@ func FilesUpload(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
dto, err := Store.Upload(userID, file, folderID)
|
||||
dto, err := Store.Upload(userID, file, folderID, resourceID)
|
||||
if err != nil {
|
||||
writeError(c, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user