diff --git a/activestorage/app/assets/javascripts/activestorage.js b/activestorage/app/assets/javascripts/activestorage.js index e2bcb520b9..6061fb9bb6 100644 --- a/activestorage/app/assets/javascripts/activestorage.js +++ b/activestorage/app/assets/javascripts/activestorage.js @@ -550,7 +550,7 @@ this.file = file; this.attributes = { filename: file.name, - content_type: file.type, + content_type: file.type || "application/octet-stream", byte_size: file.size, checksum: checksum }; diff --git a/activestorage/app/javascript/activestorage/blob_record.js b/activestorage/app/javascript/activestorage/blob_record.js index 7fbe315f76..997c123870 100644 --- a/activestorage/app/javascript/activestorage/blob_record.js +++ b/activestorage/app/javascript/activestorage/blob_record.js @@ -6,7 +6,7 @@ export class BlobRecord { this.attributes = { filename: file.name, - content_type: file.type, + content_type: file.type || "application/octet-stream", byte_size: file.size, checksum: checksum }