Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send parameter #15

Open
erhanfirat opened this issue Sep 11, 2012 · 5 comments
Open

send parameter #15

erhanfirat opened this issue Sep 11, 2012 · 5 comments

Comments

@erhanfirat
Copy link

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?

@i-e-b
Copy link
Owner

i-e-b commented Sep 11, 2012

I'm sorry, I don't understand your question.
Could you provide any sample code or scenarios?

@erhanfirat
Copy link
Author

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?

@i-e-b
Copy link
Owner

i-e-b commented Sep 13, 2012

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.

@erhanfirat
Copy link
Author

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.

@erhanfirat
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants