change file permissions to /uploads
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m0s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m0s
This commit is contained in:
@@ -48,6 +48,11 @@ func (store *Store) UploadMessageFile(ctx *gin.Context) {
|
||||
ctx.JSON(http.StatusInternalServerError, gin.H{"error": "failed to create upload directory"})
|
||||
return
|
||||
}
|
||||
// Ensure directory is world-readable so nginx can serve files
|
||||
if err := os.Chmod(uploadDir, 0755); err != nil {
|
||||
ctx.JSON(http.StatusInternalServerError, gin.H{"error": "failed to create upload directory"})
|
||||
return
|
||||
}
|
||||
|
||||
dest := filepath.Join(uploadDir, filename)
|
||||
if err := ctx.SaveUploadedFile(file, dest); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user