-
Notifications
You must be signed in to change notification settings - Fork 2
Attachments
zehavibarak edited this page Oct 27, 2022
·
1 revision
UseFileSystemFileStore(), UseDatabaseFileStore() or UseAzureFileStore().
<form [formGroup]=form>
<bizdoc-file-upload multiple accept=".pdf" formControlName="license">
</bizdoc-file-upload>
</form>@Component(templateUrl: `my-component.component.html`)
export class MyComponent {
readonly form = this._fb.group({
license: this._fb.control(null)
});
constructor(private _fb: FormBuilder) {}
}Inline attachments are private.
Properties
| Name | Usage |
|---|---|
| multiple | Default. Boolean. |
| accept | File extension, mime or global mime (image/*, etc.) |
Attachment mode
| Value | Usage |
|---|---|
| Public | Default. |
| Private | Hidden from document header. |
| CheckedOut | |
| CheckedIn |
C#
public class MyBackend : FormBase<MyModel> {
private readonly IDocumentContext _documentContext;
public MyBackend(IDocumentContext documentContext) {
_documentContext = documentContext;
}
public override Task UpdateAsync() {
foreach(var attachment in _documentContext.Document.Attachments) {
if(attachment.Mode.HasFlag(AttachmentMode.CheckedOut)) {
...
}
}
}
}
public class MyModel {
public int[] License { get; set; }
}Use
intas property type for single attachment or a collection ofintfor multiple.
Angular
export class MyComponent implements FormComponent<MyModel> {
onBind(data: DocumentModel<MyModel>) {
data.attachments.filter(a=> a.checkedOut).forEach( a=> ...);
}
}
export interface MyModel {
licensePapers: number[]
}public class MyBackend : FormBase<MyModel> {
public override Task UploadAsync(MyModel model, IFormFile file) {
...
}
}Moding Ltd.