-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add formData before upload #97
Comments
I'm running into the exact same problem as iruindegi does.. I cant modify the formData property after i instantiated the fileUploader this is what i try to do:
|
Hi, @iruindegi When a file is added to the queue, settings of uploader are copied to him. You need to change the item options: uploader.bind('beforeupload', function (event, item) {
item.formData.push({some: 'data'});
}); |
That's a great answer @nervgh My issue was for each file, I wanted to send an additional field called title. In my controller I did:
Then, the view can have the input field in the queue table from the "simple example" (http://nervgh.github.io/pages/angular-file-upload/examples/simple)
Now the issue is that if there are two files, the 'complete' event is run after the first file uploads, so the title goes away before the second item can be posted. Is there a way to know when all items in the queue are complete and then clear my titles? Thanks! |
it works for me, thanks! |
@polyesterhat
You could use the |
This should be added to an example. The docs don't really make it clear. Ended up getting stumped for quite a bit on this :( |
Hi, |
I am lst to where to place this code I hope you can help me. |
Hi i have try to add into the formData my token to certify the right to access to that url from the user. uploader.bind('beforeupload', function (event, item) {
item.formData.push({some: 'data'});
}); But i got this error " TypeError: $scope.uploader.bind is not a function" Thank for you help |
Hi, i have the same problem. |
Hi, how can I get formData in controller (asp.net mvc)? |
I solved the problem by using this function instead of bind :
Push formdata before uploading the item. |
@quangnhatt Hi, how can I get formData in controller (asp.net mvc)? |
How can i read the physical path location of the each file? and How can i read the bytearray or stream of the each file to store into the DB? Any help on this is appreciate |
How can i add an image clicked from mobile directly into the uploader queue for uploading |
@JimmyFarcy |
I was able to update the form data using onBeforeUploadItem():
|
|
uploader.onBeforeUploadItem=function(item){ |
Hi, this is my controller:
What I need is to include a new field called "izena" where I have my upload path and more data.
This is all the stuff I tried on "beforeupload" event:
but it is not working.. I can not see this param on my request on node.js
Whitch is the correct way to add new fields to upload?
thanks in advance
The text was updated successfully, but these errors were encountered: