var FormFileUpload = function() {
return {
init: function() {
$('#fileupload').fileupload({
disableImageResize: false,
autoUpload: false,
disableImageResize: /Android(?!.*Chrome)|Opera/.test(window.navigator.userAgent),
maxFileSize: 5000000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
{
withCredentials: true
},
});
$('#fileupload').fileupload('option', 'redirect', window.location.href.replace(/\/[^\/]*$/, '/cors/result.html?%s'));
if ($.support.cors) {
$.ajax({
type: 'HEAD'
}).fail(function() {
$('<div class="alert alert-danger"/>')
.text('Upload server currently unavailable - ' + new Date())
.appendTo('#fileupload');
});
}
$('#fileupload').addClass('fileupload-processing');
$.ajax({
withCredentials: true
},
url: $('#fileupload').attr("action"),
dataType: 'json',
context: $('#fileupload')[0]
}).always(function() {
$(this).removeClass('fileupload-processing');
}).done(function(result) {
$(this).fileupload('option', 'done')
.call(this, $.Event('done'), {
result: result
});
});
}
};
}();
jQuery(document).ready(function() {
FormFileUpload.init();
});
- I need to bypass file upload rules,
- Like this script only allows gif,jpeg,png,
- I need to upload some other format Is this possible
- Like php,text etc..
- Is there any way to bypass them.I am going to add this script on my website.So anyone can bypass them ,It's mandatory for my website.
java
tag for questions that have nothing to do with Java. – ajb