i have created node-webkit application using angularjs in front-end , nodejs in backend. trying load image application. works fine if internet fast. @ times,if internet slow doesn't loaded. couldn't figure out issue is. whenever want load image call service node server, , node server loads , sends image mongodb.
here code load image db:
var profilepicture = require('skipper-gridfs')({ uri: 'mongodb://' + config.fileuploaddownload.url + ':27017/' + config.fileuploaddownload.db + '.media' }); profilepicture.read(params, function (err, downloadedfile) { if (err) { res.send("found error"); } else { res.setheader('content-type', 'image/png'); res.send(downloadedfile); } }); and code rendering image in html:
<img ng-src="{{img_url}}" class="prof-ico"> //img_url url download image backend
can me in solving issue?
thanks in advance.
Comments
Post a Comment