0

I can't upload image on my meanjs app, I don't know why but I can't nake the post to express.

I followed this example: Adding a picture to the MEAN.JS sample with Angular-file-upload

But my service in angular use $resource to make a post, ex:

'use strict'; 
angular.module('eventos').factory('Eventos', ['$resource',
function($resource){
        return $resource('events/eventId', {eventId:'@_id'
},{
   update:{
          method:'PUT'
          }
    });
  }
]);

There are other approach?

I tried to find examples or tutorials but there isn't, could you help?

Thanks ;)

Community
  • 1
  • 1
Andre
  • 23
  • 1
  • 4
  • Hard time... I solved my uploading image problem following this [Question](http://stackoverflow.com/questions/25019134/how-to-upload-an-image-file-to-mongoose-database-using-mean-js/28343983#28343983). – Hareesh Mar 07 '15 at 17:12

1 Answers1

0

I used the Angular solution found here: https://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs

Then I combined this with Multer (Express Middleware), as described in this Stackoverflow question here:

Use Multer in Express Route? (Using MEANJS)

This works pretty well for me.

Community
  • 1
  • 1
aikorei
  • 570
  • 1
  • 7
  • 23