File Upload: Show additional column
File Upload: Show additional column
mp2000
Posts: 23Questions: 1Answers: 0
Hello,
I want to show the creation date of the uploaded file in the editor, but i only get "undefined | filenameXY.txt"
.
{
label: "Lizenzdateien:",
name: "CMDB_Asset_License_File[].id",
type: "uploadMany",
display: function(fileId, counter) {
return '<a href="' + editor.file('CMDB_Asset_License_File', fileId).WebPath + '">' + editor.file('CMDB_Asset_License_File', fileId).DateCreated + ' | ' + editor.file('CMDB_Asset_License_File', fileId).Filename + '</a>';
},
noFileText: 'keine Dateien'
},
My sql table has following columns: id | Filename | Filesize | WebPath | SystemPath | DateCreated
the field DateCreated has as standard "CURRENT_TIMESTAMP".
Uploading a file works fine.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Do you have the
DateCreated
field in thedb
parameters list? Can you show me that PHP or C# code please (I'm not sure which you are using)?Allan
Thx for your fast response. I don't know on which position the parameter must be.
here's my shorten php code:
In the
db()
method you haveFilename
,Filesize
,WebPath
andSystemPath
, but not theDateCreated
field, so it won't be read from the database.You should perhaps add:
Allan
now it works. I didn't know the function yet Upload::DB_READ_ONLY
Documentation for all of the options, including
DB_READ_ONLY
is available here.Allan