Become a member
Sign in
Front To Back File Uploads Using GridFS
244
7
Patrick Shaughnessy
Alex Wilkinson
Alex Wilkinson
Aug 9, 2017 · 1 min read

Great article, really helpful in covering all the steps. A suggestion, you can make fetchImage more generic by reading the content type from the response.

var contentType = resp.headers(‘Content-Type’);
var file = new Blob([resp.data], {type: contentType});

    Alex Wilkinson

    Written by

    Alex Wilkinson

    Write the first response

    Discover Medium

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

    Make Medium yours

    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

    Become a member

    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade
    AboutHelpLegal