Open erhanfirat opened 12 years ago
I'm sorry, I don't understand your question. Could you provide any sample code or scenarios?
Ofcourse, in my project, I have called file uploader in an iframe, and it is shown on our product record relatively. The files which user want to upload, is about my product object. So, when a file upload request send, I also want to learn that which record and field it is related. I should send "productId" and "fieldName" parameters for each file upload request. Is this possible?
You should be able to. I haven't worked on this in a few months, so I'll take a look at the project and let you know more details.
I found these;
https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data
And bind events works only as below:
$('#fileupload').fileupload({ add: function (e, data) { console.log('add'); data.submit(); }, progress: function (e, data) { console.log('progress'); }, start: function (e) { console.log('start'); } }).bind('fileuploadadd', function (e, data) { console.log('fileuploadadd'); }).bind('fileuploadprogress', function (e, data) { console.log('fileuploadprogress'); }).bind('fileuploadstart', function (e) { console.log('fileuploadstart'); });
[Sebastian Tschan: http://stackoverflow.com/questions/6280360/why-doesnt-blueimps-jquery-file-upload-plugin-fire-callbacks/6973703#6973703]
ALthough, I still cannot figure out why "fileuploadsubmit" callback does not fire, I can send extra data now by using these bindings.
Hello again,
I can send data now, as I mention above, however, now, I want to send these data for listing existing files.
Here is the code written in the "application.js":
// Load existing files:
$.getJSON($('#fileupload form').prop('action'), function (files) {
var fu = $('#fileupload').data('fileupload');
fu._adjustMaxNumberOfFiles(-files.length);
fu._renderDownload(files)
.appendTo($('#fileupload .files'))
.fadeIn(function () {
// Fix for IE7 and lower:
$(this).show();
});
});
Can I add some data before listing files?
Hello, I am using this version of jQueryFileUpload for my .Net project. I want to know that if I send two parameter when uploading files?