@adminforth/upload 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.log +2 -2
- package/custom/uploader.vue +1 -1
- package/dist/custom/uploader.vue +1 -1
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -11,5 +11,5 @@ custom/preview.vue
|
|
|
11
11
|
custom/tsconfig.json
|
|
12
12
|
custom/uploader.vue
|
|
13
13
|
|
|
14
|
-
sent 46,
|
|
15
|
-
total size is 46,
|
|
14
|
+
sent 46,954 bytes received 134 bytes 94,176.00 bytes/sec
|
|
15
|
+
total size is 46,465 speedup is 0.99
|
package/custom/uploader.vue
CHANGED
|
@@ -194,7 +194,7 @@ const onFileChange = async (e) => {
|
|
|
194
194
|
console.log('File details:', { name, extension, size, type });
|
|
195
195
|
// validate file extension
|
|
196
196
|
const allowedExtensions = props.meta.allowedExtensions || []
|
|
197
|
-
if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension)) {
|
|
197
|
+
if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension.toLowerCase())) {
|
|
198
198
|
adminforth.alert({
|
|
199
199
|
message: t('Sorry but the file type {extension} is not allowed. Please upload a file with one of the following extensions: {allowedExtensionsLabel}', {
|
|
200
200
|
extension,
|
package/dist/custom/uploader.vue
CHANGED
|
@@ -194,7 +194,7 @@ const onFileChange = async (e) => {
|
|
|
194
194
|
console.log('File details:', { name, extension, size, type });
|
|
195
195
|
// validate file extension
|
|
196
196
|
const allowedExtensions = props.meta.allowedExtensions || []
|
|
197
|
-
if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension)) {
|
|
197
|
+
if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension.toLowerCase())) {
|
|
198
198
|
adminforth.alert({
|
|
199
199
|
message: t('Sorry but the file type {extension} is not allowed. Please upload a file with one of the following extensions: {allowedExtensionsLabel}', {
|
|
200
200
|
extension,
|
package/dist/index.js
CHANGED
|
@@ -248,7 +248,7 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
248
248
|
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body }) {
|
|
249
249
|
var _b, _c;
|
|
250
250
|
const { originalFilename, contentType, size, originalExtension, recordPk } = body;
|
|
251
|
-
if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension)) {
|
|
251
|
+
if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension.toLowerCase())) {
|
|
252
252
|
return {
|
|
253
253
|
error: `File extension "${originalExtension}" is not allowed, allowed extensions are: ${this.options.allowedFileExtensions.join(', ')}`
|
|
254
254
|
};
|
package/index.ts
CHANGED
|
@@ -281,7 +281,7 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
281
281
|
handler: async ({ body }) => {
|
|
282
282
|
const { originalFilename, contentType, size, originalExtension, recordPk } = body;
|
|
283
283
|
|
|
284
|
-
if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension)) {
|
|
284
|
+
if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension.toLowerCase())) {
|
|
285
285
|
return {
|
|
286
286
|
error: `File extension "${originalExtension}" is not allowed, allowed extensions are: ${this.options.allowedFileExtensions.join(', ')}`
|
|
287
287
|
};
|