🐛 Fix re-upload still need in temp
This commit is contained in:
parent
00fddfdef9
commit
d979f85f68
@ -36,12 +36,9 @@ func UploadFileToTemporary(ctx *fiber.Ctx, file *multipart.FileHeader, meta mode
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ReUploadFile(meta models.Attachment, dst int) error {
|
func ReUploadFile(meta models.Attachment, dst int) error {
|
||||||
if dst == models.AttachmentDstTemporary || meta.Destination == dst {
|
if meta.Destination == dst {
|
||||||
return fmt.Errorf("destnation cannot be reversed temporary or the same as the original")
|
return fmt.Errorf("destnation cannot be reversed temporary or the same as the original")
|
||||||
}
|
}
|
||||||
if meta.Destination != models.AttachmentDstTemporary {
|
|
||||||
return fmt.Errorf("attachment isn't in temporary storage, unable to process")
|
|
||||||
}
|
|
||||||
|
|
||||||
prevDst := meta.Destination
|
prevDst := meta.Destination
|
||||||
inDst, err := fs.DownloadFileToLocal(meta, prevDst)
|
inDst, err := fs.DownloadFileToLocal(meta, prevDst)
|
||||||
|
Loading…
Reference in New Issue
Block a user