Fieldtype, Module

Developer
Supported

Protected Links

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy

     

You must be logged in to post.

All protected files have 0 filesize & no content

Support Request

xynergy_inc
xynergy_inc

Hi Yuri,
We just bought and are trying to implement this plugin to protect documents that shouldn’t ever be publicly accessible in an EE5 site, but running into problems in that every protected file generated by the

{exp:protected_links:generate url=’{my_file}’ title=’{my_title}’}

tag is 0 bytes and cannot open.  I saw in another thread you suggest to open with a text editor and look for errors, but I literally get nothing at all - 0 bytes every time.  The names of the files saved from the generated protected links do appear to be correct though, tested with PDF and DOCX and XLSX and in every case, if I access the file just with the native {my_file} tag, they all open and download just fine.

Any ideas what’s wrong?

Thanks,
Justin

Yuri Salimovskiy
# 1
Developer
Yuri Salimovskiy

What does {my_file} return - is it fully qualifiled URL or relative path? It needs to be either full URL including protocol and domain name, or absolute file path (in that case, include storage=‘local’ param)
To get some error message, try increasing debug mode in EE preferences, if that still does not help, there’s likely error suppressing set in some of third party code

xynergy_inc
# 2
xynergy_inc

Hi Yuri,
{my_file} does indeed return the full URL including protocol, eg:  https://dev.exampleclient.com/path/to/file.pdf

I did try enabling all the EE debugging everywhere, even trying Brian’s advanced debugging from https://gist.github.com/litzinger/5598641, but nothing seems to help.  I also can’t seem to get inline=‘yes’ to work, so all I can get is a save/open dialogue but even before I save or open the file, it shows in the save/open dialogue popup that the file is 0 bytes.  I tried testing this in our EE boilderplate install and everything except for inline=‘yes’ works fine there… so I agree it’s either some kind of conflict with another third-party addon or possibly even environment related.  Might be worth looking at the inline setting as opening PDFs in a new browser tab would be ideal.

Switching over to use storage=‘local’ does fix the problem for the client in question though, but I was hoping not to have to hard-code a path in my templates… but that might be the best solution after all though because I think I’ve settled on moving the protected documents folder above the webroot.  I’ll implement that and we should be good but I’ll let you know if I get stuck again.

Thanks for the quick response!