mirror of https://github.com/rails/rails
Multi-service direct uploads in Action Text attachment uploads
This commit is contained in:
parent
27f17b98d6
commit
0b69ad4de6
|
@ -4,7 +4,7 @@ export class AttachmentUpload {
|
|||
constructor(attachment, element) {
|
||||
this.attachment = attachment
|
||||
this.element = element
|
||||
this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this)
|
||||
this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this.directUploadToken, this.attachmentName, this)
|
||||
}
|
||||
|
||||
start() {
|
||||
|
@ -42,4 +42,11 @@ export class AttachmentUpload {
|
|||
get blobUrlTemplate() {
|
||||
return this.element.dataset.blobUrlTemplate
|
||||
}
|
||||
|
||||
get directUploadToken() {
|
||||
return this.element.getAttribute("data-direct-upload-token");
|
||||
}
|
||||
get attachmentName() {
|
||||
return this.element.getAttribute("data-direct-upload-attachment-name");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue