Changing attachments to use php path
This commit is contained in:
parent
a99b818f6b
commit
34747336dd
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue