diff --git a/ghost/admin/app/components/modal-import-content/content-file-select.js b/ghost/admin/app/components/modal-import-content/content-file-select.js index c490f15d27..1e877e383c 100644 --- a/ghost/admin/app/components/modal-import-content/content-file-select.js +++ b/ghost/admin/app/components/modal-import-content/content-file-select.js @@ -18,12 +18,8 @@ export default class ContentFileSelect extends Component { @action fileSelected(fileList) { - console.log('File list: ' + JSON.stringify(fileList)); - let [file] = Array.from(fileList); - console.log('Validating file: ' + JSON.stringify(file)); - try { this._validateFileType(file); this.error = null; @@ -32,8 +28,6 @@ export default class ContentFileSelect extends Component { return; } - console.log('Setting file to: ' + JSON.stringify(file)); - this.args.setFile(file); } @@ -67,14 +61,16 @@ export default class ContentFileSelect extends Component { event.preventDefault(); this.dragClass = null; if (event.dataTransfer.files) { + console.log("dropped: ", event.dataTransfer.files); this.fileSelected(event.dataTransfer.files); } } _validateFileType(file) { + console.log(file); let [, extension] = (/(?:\.([^.]+))?$/).exec(file.name); - if (extension.toLowerCase() !== 'json' || extension.toLowerCase() !== 'zip') { + if (extension.toLowerCase() !== 'json' && extension.toLowerCase() !== 'zip') { throw new UnsupportedMediaTypeError({ message: 'The file type you uploaded is not supported' });