code: function sendFile (req, res, next, file) {
    if (file instanceof Buffer) {
      setContentType(req, res, ["application/octet-stream", "*/*"]);
  
      // `file` is the file's contents
      util.debug("Sending raw buffer data");
      res.send(file);
      return;
    }
  
    if (typeof file === "string" || file instanceof String) {
      setContentType(req, res, ["application/octet-stream", "*/*"]);
  
      // `file` is the file's contents as as string
      util.debug("Sending raw string data");
      res.send(file);
      return;
    }
  
    // `file` is a file info object
    fs.exists(file.path || "", (exists) => {
      if (exists) {
        let isAttachment = _.some(res.swagger.headers, (header, name) => {
          return name.toLowerCase() === "content-disposition";
        });
  
        if (isAttachment) {
          // Get the filename from the "Content-Disposition" header,
          // or fallback to the request path
          let fileName = /filename\=\"(.+)\"/.exec(res.get("content-disposition"));
          fileName = fileName ? fileName[1] : req.path;
  
          util.debug('Sending "%s" as an attachment named "%s"', file.path, fileName);
          res.download(file.path, fileName);
        }
        else {
          util.debug('Sending "%s" contents', file.path);
          res.sendFile(file.path, { lastModified: false });
        }
      }
      else {
        // Throw an HTTP 410 (Gone)
        util.debug('Unable to find the file: "%s".  Sending an HTTP 410 (Gone)', file.path);
        next(ono({ status: 410 }, "%s no longer exists", file.path || req.path));
      }
    });
  }
docs: Sends the given file as the response.
  If the file doesn't exist, then an HTTP 410 (Gone) is thrown
  
  @param   {Request}           req
  @param   {Response}          res
  @param   {function}          next
  @param   {object|Buffer}     file