You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am desperately trying to find a way to place the filename for the uploaded document as a field in the schema. Does anyone have any idea how to acheive this.
I'd like the user to select the file from autoform as usual and the filename from the selected file inserted into the relevant field.
Example schema..
Manual = new Mongo.Collection("manuals");
Manual.attachSchema(new SimpleSchema({
section: {
type: String,
optional: false,
label: "Section",
allowedValues: ['Safety', 'Emergency Information']
},originalfilename: {
type: String, <<--------------- I'd like to get the filename of the selected file into here
optional: false,
label: "Original Filename",
},
date:{
type: Date,
optional: false,
label: "Date Updated",
autoform: {
type: 'hidden',
},
autoValue: function() {
if (this.isInsert) {
return new Date();
} else if (this.isUpsert) {
return {
$setOnInsert: new Date()
};
}else if (this.isUpdate) {
return new Date();
} else {
this.unset();
}
}
},
document: {
type: String,
optional: false,
autoform: {
afFieldInput: {
type: 'fileUpload',
collection: 'Documents',
label: 'Choose file',
accept: '.pdf'
}
}
}
If anyone has any idea that would be great... thanks heaps in advance.
The text was updated successfully, but these errors were encountered:
I am desperately trying to find a way to place the filename for the uploaded document as a field in the schema. Does anyone have any idea how to acheive this.
I'd like the user to select the file from autoform as usual and the filename from the selected file inserted into the relevant field.
Example schema..
If anyone has any idea that would be great... thanks heaps in advance.
The text was updated successfully, but these errors were encountered: