vsivsi / meteor-file-collection

Extends Meteor Collections to handle file data using MongoDB gridFS.
http://atmospherejs.com/vsivsi/file-collection
Other
159 stars 37 forks source link

View documents in browser instead of download, #150

Open mbateman opened 7 years ago

mbateman commented 7 years ago

Thanks a lot @vsivsi for such a powerful package.

I'm trying to use your package to store documents in mongodb which does very well. My question is can I open a document in a new tab in the browser instead of downloading it? The usual method of missing off ?download=true and including target="_blank" doesn't seem to work: it downloads a file but with the md5 name as the file name.

This is probably obvious but I can't get the usual approaches to work.

Thanks

mbateman commented 7 years ago

Sorry about this, but a little more research revealed that it looks like this is only possible with pdfs. However, if you know something to the contrary, I would like to know.

Thanks.

vsivsi commented 7 years ago

What other kind of documents are you thinking of, MSWord .doc / .docx files? This is out of scope for supporting this package, but I bet there is a Javascript MSWord viewer out there somewhere... Maybe this? https://blogs.office.com/2013/04/10/office-web-viewer-view-office-documents-in-a-browser/