Welcome, Guest
Username: Password: Remember me

TOPIC: Corrupted pdf download from attachements?

Corrupted pdf download from attachements? 5 months 2 weeks ago #25944

Hi,
no solutions founded...
1) disabled all plugins
2) disabled gzip
3) disabled https
4) downgraded php to 7.0
5) uploaded website on dev server or tests dev-server
6) loaded phocadownload : it works correctly... phoca download
7) changed the template to Protostar
I have no others ides...
Any suggestion ?

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

Corrupted pdf download from attachements? 5 months 2 weeks ago #25946

  • Egnarts
  • Egnarts's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 262
  • Karma: -3
  • Thank you received: 112

stefanato wrote: I have no others ideas...


Same here, sorry.
Take a look at the responsive version of JEM: The Responsive JEM

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

Last edit: by Egnarts.

Corrupted pdf download from attachements? 5 months 1 week ago #25993

My users were reporting issues with opening/downloading attachments as well, especially on mobile devices. I ended up replacing link to function getfile with simple link to the file itself. No download issues reported since.

In file
/components/com_jem/common/views/tmpl/default_attachments.php
Replace these 2 lines
$attribs	= array('class'=>'file-name');
echo JHtml::_('link','index.php?option=com_jem&task=getfile&format=raw&file='.$file->id,$image,$attribs);
With these 2 lines
$attribs	= array('class'=>'file-name','target'=>'_blank');
echo JHtml::_('link',str_replace(JPATH_SITE, "", JEMAttachment::getAttachmentPath($file->id)),$image,$attribs);

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

Corrupted pdf download from attachements? 5 months 1 week ago #25996

Hi, thanks for suggestion and this seems to be the right way, but in the link created the domain is missed :
new download link : https://media/com_jem/attachments//event679/foto_a_pagina_intera_859405488.pdf
but should be www.omco.pd.it/media/com_jem/attachments...intera_859405488.pdf
Any suggestion ?
This is the working page: www.omco.pd.it/formazione/corsi-e-conveg...iritti-e-doveri.html

thanks in advance.

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

Corrupted pdf download from attachements? 5 months 1 week ago #25997

It looks like your Attachment Path (BE->Components->JEM->Settings ->Global Parameters tab) has "/" before and after path, thus creating starting //, which prevents browser from adding domain name. This is due to function postUpload in JEMAttachment class adding / on line 38
$path = JPATH_SITE.'/'.$jemsettings->attachments_path.'/'.$object;
If you can modify Attachment Path not to have / surrounding your media/com_jem/attachments that will resolve the missing domain in link.

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

Corrupted pdf download from attachements? 5 months 1 week ago #25998

Just thought of something... that will work only for newly added attachments, since the attachment path is stored in DB. Probably, best then to add code to replace all "//" in attachment path with "/". Will test now and post here next few minutes.

Checked - attachment path is not stored in DB, so amending settings will do the trick.

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

Last edit: by depebo. Reason: checked DB and added last statement
Time to create page: 0.224 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.

Follow us......