Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Broken PDF attachment

Broken PDF attachment 3 months 2 weeks ago #26107

  • HerKle
  • HerKle's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Style is poor man's basic right
  • Posts: 154
  • Thank you received: 23
This topic was already part of a two-themes-topic:
https://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.

Broken PDF attachment 3 months 2 weeks 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...ements?start=6#25993
The following user(s) said Thank You: HerKle

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

Broken PDF attachment 3 months 2 weeks ago #26111

  • HerKle
  • HerKle's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Style is poor man's basic right
  • Posts: 154
  • Thank you received: 23
Luckily, this did help me. I just had to consider the responsive version of the file to amend:
/components/com_jem/common/views/tmpl/default_attachments_responsive.php

Replacing the lines 37 and 38 by
$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
templates/mytemplate/html/com_jem/common/default_attachments_responsive.php

made the downloads work. Thanks, depebo!
Regards,
Herbert

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

Last edit: by HerKle.

Broken PDF attachment 3 months 2 weeks 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).
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.

  • Page:
  • 1
Time to create page: 0.229 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.