Skip to content

Commit 27b792f

Browse files
committed
Set Content-Type from the file type
1 parent 4662ffc commit 27b792f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ui/src/components/view/ObjectStoreBrowser.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,12 @@ export default {
489489
asyncUploadFile (file, objectName) {
490490
return new Promise((resolve, reject) => {
491491
file.arrayBuffer().then((buffer) => {
492-
this.client.putObject(this.resource.name, objectName, Buffer.from(buffer), file.size, this.uploadMetaData, err => {
492+
const metadata = {
493+
...this.uploadMetaData,
494+
'Content-Type': file.type || 'binary/octet-stream'
495+
}
496+
497+
this.client.putObject(this.resource.name, objectName, Buffer.from(buffer), file.size, metadata, err => {
493498
if (err) {
494499
return reject(this.$notification.error({
495500
message: this.$t('message.upload.failed'),

0 commit comments

Comments
 (0)