jemproject / JEM-Project

JEM - an Event Manager for Joomla
https://www.joomlaeventmanager.net
GNU General Public License v3.0
25 stars 36 forks source link

downloading an attached *.pdf on a smartphone will be changed into a*.pdf.html (with an additional .html #1693

Closed jojo12 closed 2 months ago

jojo12 commented 7 months ago

there's a post of bergente in forum. I can reproduce this. Is this a bug from JEM ? ( when I cut the .html and let *.pdf, the attachment can be red normal.)

mckillo commented 7 months ago

Yes, it a JEM bug. I'll debut it tomorrow.

mckillo commented 2 months ago

@jojo12 Forgot this issue, I would like to solve it before release 4.2.1. Tomorrow I tell you any new.

mckillo commented 2 months ago

I simulate it...

mckillo commented 2 months ago

@jojo12 Please test it and tell me if It works for you. See the commit above.

jojo12 commented 2 months ago

I made a fresh zip from JEM4.2.1-dev installed and tested then on my smartphone: when pdf is opened, there are very cryptic signs (not possible to read)! -> not fixed!

mckillo commented 2 months ago

I tested it again, in JL 4.4.4 with PHP 8.1 and JL 5.1.0 with 8.2, attachements jpg, png and pdf files. it works. Test with other files or send PM with the PDF file. Now, fopen uses rb (read in binary mode).

jojo12 commented 2 months ago

I tested (in J!5.1) with jpg too. In smartphone it adds an additional .html. When I cut this manually, then I can read the original. If not, then all is cryptic. Even when I open it as html.

mckillo commented 2 months ago

I can download tour PDF and I see that is music sheet. I don't know where is the problem. Test with other navigator.

jojo12 commented 2 months ago

With my smartphone it does not work. Perhaps it is the problem of the smartphone. Because I know how to procedure ( take away the added .html) we can let this! It won't be fixed.

Heklaterriol commented 2 months ago

In my iPhone it is still with the html extension, like filename.pdf.html and opens as text (pdf raw code)

mckillo commented 2 months ago

Sorry, the commit above is for issue "archive icon in view", copied other title.

mckillo commented 2 months ago

@Heklaterriol I use Androir and iPhonoe with Chrome and Firefox, and it works. This issue is with Safari in IPhone and save PDF as HTML Why? Any idea, look for info.

jojo12 commented 2 months ago

I tested in Android with Chrome and Firefox. Had the error on both.

mckillo commented 2 months ago

@jojo12 when you can, test the commit above with files (several extensions). I think that it work now.

jojo12 commented 2 months ago

Hi, I exchanged the file with your new one, cleared cache. Then went to smartphone and downloaded the attachment. Same error. I tried with an attachmend in the new uddeIM. I get a good result. So in JEM the problem persists. (sorry)

mckillo commented 2 months ago

Have you apply the last commit? If it's so. Now I can't simulate the error, in my test it works.

jojo12 commented 2 months ago

yes, that was the last commit. Don't loose time for that, there's a solution, not the best, but it works.

jojo12 commented 2 months ago

that's strange: after a bit time, I have installed and uninstalled a pdf viewer on my smartphone, the download, does not change to .html. But first it says, it can not read it. When I open then in the download folder I am asked which pdf reader and then I can read it.

mckillo commented 2 months ago

But was the file saved as .pdf or .html?

jojo12 commented 2 months ago

now it was saved as .pdf

Heklaterriol commented 2 months ago

the fix works here too. @mckillo thx!