Meteor-files: Embedding encrypted files

Created on 7 Jun 2019  Â·  3Comments  Â·  Source: veliovgroup/Meteor-Files

I have files that are stored encrypted, when I generate a URL for them the interceptDownload hook decrypts them and sends them over to the client, the file gets downloaded and everything works fine. Now if I try to use the URL in an embed html object or similar, I get an error saying that the file PDF in this case cannot be loaded. Is there a way to stream + decrypt files without the user having to specifically download them ?

If there's any other alternative way of doing this I'm open to suggestions as well.

.serve() question

All 3 comments

Hello @sylido ,

I'd like to see server logs for both cases to understand difference. Please, post server logs with enabled debug option for "download" and for "embedded" file

@sylido friendly ping

hey @dr-dimitru I think I had the wrong headers going - I was trying with the download one which didn’t work. Next I tried with “inline” which resulted in the browser’s tab freezing. Then I just removed that header part completely and the stream + download now work as expected, thanks for the nudge in the right direction.

Was this page helpful?
0 / 5 - 0 ratings