silexlabs / unifile

Unified access to cloud storage services through a simple web API.
https://silexlabs.github.io/unifile/
MIT License
144 stars 32 forks source link

question about mime types #93

Closed lexoyo closed 7 years ago

lexoyo commented 7 years ago

hello thank you so much for the awsome library when i do this, what is the best way to set the mimetype header? is there a way to access the mimetype header as provided by the third party service?

    app.get(/\/(.*)\/get\/(.*)/, (req, res) => {
      this.unifile.readFile(req.session.unifile, req.params[0], req.params[1])
      .then((result) => {
        res..send(result);
      })
      .catch((err) => {
        console.error(err);
        res.status(400).send(err);
      });
    });
JbIPS commented 7 years ago

You can access the MIME type by using the .stat() method.

lexoyo commented 7 years ago

Great it works fine, thx https://github.com/lexoyo/CloudExplorer2/commit/5d3877542c69a91ee8bba74f47cd76c3a10e449f