Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 7aa6c1e

Browse files
author
vikasrohit
committed
AS#152122905738640, File upload: inconsistent validation with preview image upload
-- Fixed with catch that it still allows any file named with zip extension.
1 parent add29e7 commit 7aa6c1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/directives/tc-fp-file-input/tc-fp-file-input.directive.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ import _ from 'lodash'
3232
scope.filePath += _.join([userId, scope.fieldId, (new Date()).valueOf()], '-') + '.zip'
3333
}
3434
var dragAreaClasses = 'tc-fp-file-drag-drop'
35-
// set extensions
35+
// set mimeTypes
3636
if (scope.fieldId.indexOf('ZIP') > -1) {
37-
scope.extensions = '.zip'
37+
scope.mimeTypes = 'application/zip'
3838
} else if (scope.fieldId.indexOf('DESIGN_COVER') > -1) {
39-
scope.extensions = '.png,.jpeg,.jpg,.bmp'
39+
scope.mimeTypes = 'image/png,image/jpeg,image/bmp'
4040
dragAreaClasses += ' tc-fp-file-drag-drop-image'
4141
}
4242

@@ -64,7 +64,7 @@ import _ from 'lodash'
6464
input.setAttribute('data-fp-button-class', 'tc-btn')
6565
input.setAttribute('data-fp-drag-class', dragAreaClasses)
6666
input.setAttribute('data-fp-multiple', false)
67-
input.setAttribute('data-fp-extensions', scope.extensions)
67+
input.setAttribute('data-fp-mimetypes', scope.mimeTypes)
6868
input.setAttribute('data-fp-store-location', 's3')
6969
input.setAttribute('data-fp-store-container', scope.fpContainer)
7070
input.setAttribute('data-fp-store-path', scope.filePath)

0 commit comments

Comments
 (0)