2
votes

I was trying to use loopback-component-storage. It's all working fine.

The one thing that I cannot figure out is how do I observe a file upload completion within loopback, when the following API is called:

http://localhost:3000/api/Epubs/{container}/upload | POST

I tried using afterRemote(".") & observe("access"). None of them seem to trigger.

1

1 Answers

2
votes

You can use afterRemote on method 'upload'. In your case that will be

Epub.afterRemote( 'upload', function( ctx, modelInstance, next) { 
 ...
 next();
});

See remote hooks docs