blueimp

Blueimp file uploader with IE9

拜拜、爱过 提交于 2019-11-29 15:12:17
I am uploading a file to a REST API using this plugin in an AngularJS application. When seconds after the 'fileuploaddone' event fires, I get a yellow notification from Internet Explorer saying: Would you like to save \ open the Screenshot attached. Iframe based uploads require a Content-type of text/plain or text/html for the JSON response - they will show an undesired download dialog if the iframe response is set to application/json. Source: https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation You will need to set the right Content-Type as explained in the link

jQuery:File+Data upload using Blueimp File Upload plugin on form submit

偶尔善良 提交于 2019-11-29 07:42:53
I am using Blueimp File Upload plugin to upload file. Let say I have following form: <form id="myForm"> <input type="text" name="n1" /> <input type="text" name="n3" /> <input type="text" name="n3" /> <input type="file" name="files" id="file" style="display: none" multiple/> <button>Upload</button> </form> My job is I want to upload files+data when use click Upload button. I have done auto file upload i.e. uploading file just after drag drop or selecting file. But for this one I have no idea how to do.Can I have some simple example for this kind of cases? You need something like this: var

blueimp jquery file upload - “done”, “complete” callbacks not working for IE 9

不羁的心 提交于 2019-11-29 05:55:39
I am using Blueimp Jquery File Upload plugin to upload files asynchronously. It works well in most other browsers (with a few minor issues) - on IE, I see this issue that the "done", "stop", "always", "complete" and some other event callbacks are not getting invoked. While debugging, I added console.logs in the "done", "fail", "always", and added a "complete" method to the ajax request in the _onSend function (in jquery.fileupload.js) - but none of them seem to get invoked in IE. _onSend: function (e, data) { var that = this, jqXHR, slot, pipe, options = that._getAJAXSettings(data), send =

Jquery file upload plugin: how to validate files on add?

时间秒杀一切 提交于 2019-11-28 18:54:54
$('#fileupload') .fileupload({ acceptFileTypes: /(\.|\/)(jpg)$/i }) .on('fileuploadadd', function (e, data) { console.log(data.files.valid); //undefined setTimeout(function () { console.log(data.files.valid); //true or false }, 500); }) ; jsFiddle How to get boolean value of property data.files.valid without timeout ? Here is what you want to do: $('#fileupload') .fileupload({ acceptFileTypes: /(\.|\/)(jpg)$/i }) .bind('fileuploadadded', function (e, data) { console.log(data.files.valid); }); The core jquery.fileupload.js file is adding your files and triggering the "fileuploadadd" event, but

jQuery FileUpload doesn't trigger 'done'

笑着哭i 提交于 2019-11-28 10:46:19
I use jQuery-File-Upload plugin. I wrote a simple code to test it - and it works, but not without problems. It doesn't trigger done , even if the file is uploaded and progress bar reached its end. Here's the code: $('#file_file').fileupload({ dataType: 'json', autoUpload: true, add: function (e, data) { data.context = $('<p/>').text('Uploading...').appendTo(document.body); data.submit(); }, progressall: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .bar').css( 'width', progress + '%' ); }, done: function (e, data) { alert('Done'); } }); My input

Programmatically add a file to jquery fileupload

眉间皱痕 提交于 2019-11-28 10:22:26
问题 I'm using blueimp/jQuery-File-Upload to allow users to upload attachments when creating a inquiry on my site. I need to extend the current functionality to add a auto generated image to the queue. The image I need to add is an exported canvas, thus a base64 encoded string, i.e something like data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNby // blAAAADElEQVQImWNgoBMAAABpAAFEI8ARAAAAAElFTkSuQmCC How can I add such a file to the upload queue? I am stuck and don't know where to

How to upload a file only once with blueimp file upload plugin?

懵懂的女人 提交于 2019-11-28 09:16:53
I'm using the bluimp jQuery-File-Upload-plugin . It's no problem to select some files and upload them, but when I want to upload another files without refreshing the page, the first ones are getting uploaded again. My question is how can I "unset" files after they are uploaded. Here is my sourcecode Javascript: $('#MappeFile').fileupload({ dataType : 'json', autoUpload : false, maxNumberOfFiles : undefined, maxFileSize : 6000000, minFileSize : undefined, acceptFileTypes : /.+$/i, url : "/ajax/UploadFile.php", add : function(e, data) { $("#testUploadButton").on("click", function() { $('

blueImp/jquery file upload - How do I get the error message if the file type was not accepted?

我的未来我决定 提交于 2019-11-28 08:57:27
I want to use the BlueImp/Jquery File Upload to be able to upload some images to web webserver. I have this JS code which I generated by reading many sources $('#file_upload').fileupload('option', { dataType: 'json', url: '/Upload/UploadFiles', maxFileSize: 5000000, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, process: [ { action: 'load', fileTypes: /^image\/(gif|jpeg|png)$/, maxFileSize: 20000000 // 20MB }, { action: 'resize', maxWidth: 1440, maxHeight: 900 }, { action: 'save' } ], progressall: function (e, data) { $(this).find('.progressbar').progressbar({ value: parseInt(data.loaded / data

Blueimp file uploader with IE9

旧街凉风 提交于 2019-11-28 08:49:49
问题 I am uploading a file to a REST API using this plugin in an AngularJS application. When seconds after the 'fileuploaddone' event fires, I get a yellow notification from Internet Explorer saying: Would you like to save \ open the Screenshot attached. 回答1: Iframe based uploads require a Content-type of text/plain or text/html for the JSON response - they will show an undesired download dialog if the iframe response is set to application/json. Source: https://github.com/blueimp/jQuery-File

Optional File Upload with Blueimp jquery file upload plugin

一曲冷凌霜 提交于 2019-11-28 00:33:05
问题 The question is related to jquery file upload plugin from blueimp I am building a form where the file uploads are optional. It turns out I cannot post form when there are no files selected for upload. Just because of this I have to create two forms on my page and do all the dirty checking to delete uploaded files if the user decides not to add actual data. The question is : Can I submit the form even if no files are selected so that i can still be able to receive the additional form data on