help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

Broken PDF attachment

Broken PDF attachment

5 years 7 months ago
#26107
This topic was already part of a two-themes-topic:
www.joomlaeventmanager.net/forum/jem-2-2-x-on-joomla-3/10277-how-to-delete-an-attachment-why-is-pdf-broken?start=6 – but it lost being followed. So I take it up again:

Which 3rd part plugin can be responsible for this change of pdf content?

Original pdf file:

This browser does not support PDFs. Please download the PDF to view it: Download PDF



PDF file opened as JEM Event Detail attachment:

This browser does not support PDFs. Please download the PDF to view it: Download PDF



Thx again,
Regards,
Herbert

Attachments:

Please Log in or Create an account to join the conversation.

Re: Broken PDF attachment

5 years 7 months ago
#26110
It may be something to do with how JEM streams attachments. I had a similar problem and ended up replacing call to JS function with simple link.
See this topic for more details www.joomlaeventmanager.net/forum/jem-2-2-x-on-joomla-3/10486-corrupted-pdf-download-from-attachements?start=6#25993
The following user(s) said Thank You: HerKle

Please Log in or Create an account to join the conversation.

Re: Broken PDF attachment

5 years 7 months ago - 5 years 7 months ago
#26111
Luckily, this did help me. I just had to consider the responsive version of the file to amend:
Code:
/components/com_jem/common/views/tmpl/default_attachments_responsive.php

Replacing the lines 37 and 38 by
Code:
$attribs = array('class'=>'file-name','target'=>'_blank'); echo JHtml::_('link',str_replace(JPATH_SITE, "", JEMAttachment::getAttachmentPath($file->id)),$image,$attribs);

and using it in template override
Code:
templates/mytemplate/html/com_jem/common/default_attachments_responsive.php

made the downloads work. Thanks, depebo!
Regards,
Herbert
Last edit: 5 years 7 months ago by HerKle.

Please Log in or Create an account to join the conversation.

Re: Broken PDF attachment

5 years 7 months ago
#26112
As far as I am aware there is no file content manipulation on upload of file (only file name is changed and sanitised).
Code:
JFile::upload
method of Joomla! is used.
Is it definitely corrupted during upload? - i.e. you have located and downloaded the file directly using FTP to compare with the original.

Please Log in or Create an account to join the conversation.

Re: Broken PDF attachment

4 years 8 months ago
#26991
Hi there,
thanks for integrating responsive design into JEM 2.3.x!

Unfortunately, PDF showed broken again - but thx to depebo and his trick described in this post pdf download worked again.

I only had to make a new template overidde into mytemplate/html/com_jem/common/responsive/default_attachment.php

Double thank now to depebo!
Regards,
Herbert

Please Log in or Create an account to join the conversation.

Time to create page: 0.508 seconds