Get data back after posting files to gridfs with angular-file-upload


I post files from my controller, to my server, where gridfs writes them. After that, there is a writestream.on(‘close’) where I can console.log the file._id to the terminal.

How can I set a variable back in my angular controller to the file._id?
The server doesn’t know what angular is, so how can I access it? Also, the angular-file-upload automatically makes the post, so I’m not sure how I could add a callback.


You can look at the examples for a full list of subscribers. This could be what you’re looking for:

uploader.onCompleteItem = function(fileItem, response, status, headers) {'onCompleteItem', fileItem, response, status, headers);

Answered By – quanfoo

Answer Checked By – Cary Denson (AngularFixing Admin)

Leave a Reply

Your email address will not be published.