AddFiles adds the provided file(s) to the specified file field.
If the file field is a SINGLE-value file field (aka. "Max Select = 1"), then the newly added file will REPLACE the existing one. In this case if you pass more than 1 files only the first one will be assigned.
If the file field is a MULTI-value file field (aka. "Max Select > 1"), then the newly added file(s) will be APPENDED to the existing one(s).
Example
f1, _ := filesystem.NewFileFromPath("/path/to/file1.txt")
f2, _ := filesystem.NewFileFromPath("/path/to/file2.txt")
form.AddFiles("documents", f1, f2)
Rest
...files: filesystem.File[]Data returns the loaded form's data.
FilesToUpload returns the parsed request files ready for upload.
LoadData loads and normalizes the provided regular record data fields into the form.
LoadRequest extracts the json or multipart/form-data request data and lods it into the form.
File upload is supported only via multipart/form-data.
RemoveFiles removes a single or multiple file from the specified file field.
NB! If filesToDelete is not set it will remove all existing files assigned to the file field (including those assigned with AddFiles)!
Example
// mark only only 2 files for removal
form.RemoveFiles("documents", "file1_aw4bdrvws6.txt", "file2_xwbs36bafv.txt")
// mark all "documents" files for removal
form.RemoveFiles("documents")
Rest
...toDelete: string[]Submit validates the form and upserts the form Record model.
You can optionally provide a list of InterceptorFunc to further modify the form behavior before persisting it.
Rest
...interceptors: InterceptorFunc<models.Record>[]base model fields
Generated using TypeDoc
RecordUpsert is a [models.Record] upsert (create/update) form.