Set Content-Type from the file type (#11093)

This commit is contained in:
Abhisar Sinha 2025-07-23 16:12:53 +05:30 committed by GitHub
parent 666784f4e5
commit d63899fc8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -489,7 +489,12 @@ export default {
asyncUploadFile (file, objectName) {
return new Promise((resolve, reject) => {
file.arrayBuffer().then((buffer) => {
this.client.putObject(this.resource.name, objectName, Buffer.from(buffer), file.size, this.uploadMetaData, err => {
const metadata = {
...this.uploadMetaData,
'Content-Type': file.type || 'binary/octet-stream'
}
this.client.putObject(this.resource.name, objectName, Buffer.from(buffer), file.size, metadata, err => {
if (err) {
return reject(this.$notification.error({
message: this.$t('message.upload.failed'),