I can download images and pdf, but I can't download documents files (.doc .pptx .odt ...)
when download Documents(.doc .pptx .odt ...) are downloaded as .ZIP only XML files. What I can do?
I'm using : fill out upload file docs
upload: function (req, res) {
req
.file('avatar')
.upload({
maxBytes: 10000000
}, function whenDone(err, uploadedFiles) {
if (err) {
return res.negotiate(err);
}
// Generate a unique URL where the avatar can be downloaded.
avatarUrl = require('util').format('%s/user/avatar/%s', sails.getBaseUrl(), req.session.User.id_user),
// Grab the first file and use it's `fd` (file descriptor)
avatarFd = uploadedFiles[0].fd
var SkipperDisk = require('skipper-disk');
var fileAdapter = SkipperDisk(/* optional opts */);
// Stream the file down
fileAdapter.read(avatarFd).on('error', function (err){
return res.serverError(err);
}).pipe(res);
});
},