Changing attachments to use php path

This commit is contained in:
Finley Ghosh 2025-12-08 21:41:22 +11:00
parent a99b818f6b
commit 34747336dd

View file

@ -172,11 +172,13 @@ func (h *AttachmentHandler) Create(w http.ResponseWriter, r *http.Request) {
} }
// Create database record // Create database record
// Store path in PHP format: /var/www/cmc-sales/app/webroot/attachments_files/filename
phpPath := "/var/www/cmc-sales/app/webroot/attachments_files/" + filename
params := db.CreateAttachmentParams{ params := db.CreateAttachmentParams{
PrincipleID: int32(principleID), PrincipleID: int32(principleID),
Name: name, Name: name,
Filename: handler.Filename, Filename: handler.Filename,
File: filePath, // Store full path for PHP compatibility File: phpPath, // Store PHP container path for compatibility
Type: handler.Header.Get("Content-Type"), Type: handler.Header.Get("Content-Type"),
Size: int32(handler.Size), Size: int32(handler.Size),
Description: description, Description: description,