Opened 7 years ago
Closed 7 years ago
#1483970 closed Bugs (fixed)
Cannot view attached PDF files - blank screen results
| Reported by: | LeftTwin | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | |
| Component: | Client Scripts | Version: | 0.1-beta2 |
| Severity: | normal | Keywords: | pdf,rcmail_message_attattachmentsachments, |
| Cc: |
Description
I have 0.1beta2 installed on a Fedora Core 5 server, and a Windows XP desktop running IE and Adobe Reader 7.08.
If I read an email with an attached PDF file, and click on the PDF attachement, RC launches a new viewing window with a "Loading data..." message which eventually goes away, but no PDF ever shows.
I have tried a number of different PDF files with different filenames thinking it might be an illegal filename, but that was not the case. Even "bob.pdf" results in the same issue.
I am a PHP programmer and a Linux sysadmin, so am willing to fiddle if you point me in the right direction, and report back on my progress.
Thanks!
Change History (3)
comment:1 Changed 7 years ago by LeftTwin
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 7 years ago by Core
- Keywords pdf,rcmail_message_attattachmentsachments, added
- Resolution fixed deleted
- Status changed from closed to reopened
Well, i try that solution LeftTwin?, and that's not "bullet proof".
In same computers, the download form from IE or another browser really appears, but not always. In many give a Acrobat error , samething like "The file is open in another aplication", or it simplys blocks.
My temporary solution was, make that an attachment always open on the frame window, but with no frame, only visible the "rcmail_message_part_controls", that is the "[NAME] [Download]" labels.
Ok, its this too "bullet proof" ? NO! with .pdf files is, but with .tiffs files it just not work well. Imagine this, i have a file named [Sin Titulo.tiff] , in the [message.html] it appears normaly, we click on the link, and like i program it appears the "frame-thing" with no frame, but in this case the name file is {=?iso-8859-1?Q?Sin_t=EDtulo.tif?=} what a weck?!?
Arquivo =?iso-8859-1?Q?Sin_t=EDtulo.tif?= [download]
Tamanho 266 KB
When i click on download, apears the "download-form" of the browser , and the name file = CAM7C9EN , ok this is strange and confusion, but for this i have to rename to [THESTRNGENAME].tiff , and work fine :)
My temporary Solution for the .PDF thing :
[OPEN AND MAKE BACKUP]
skins/default/templates/messagepart.html
[FIND IN AND DELETE]
<div id="messagepartcontainer">
<roundcube:object name="messagePartFrame" id="messagepartframe" width="100%" height="85%" />
</div>
[OPEN AND MAKE BACKUP]
program/steps/mail/show.inc
[FIND IN]
function rcmail_message_attachments($attrib)
{
global $CONFIG, $OUTPUT, $PRINT_MODE, $MESSAGE, $GET_URL, $JS_OBJECT_NAME;
if (sizeof($MESSAGEattachments?))
{
allow the following attributes to be added to the <ul> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
$out = '<ul' . $attrib_str . ">\n";
foreach ($MESSAGEattachments? as $attach_prop)
{
if ($PRINT_MODE)
$out .= sprintf('<li>%s (%s)</li>'."\n",
else
$out .= sprintf('<li><a href="#attachment" onclick="return %s.command(\'load-attachment\',{part:\'%s\', mimetype:\'%s\'},this)">%s</a></li>'."\n",
$JS_OBJECT_NAME,
$attach_proppart_id?,
$attach_propmimetype?,
$attach_propfilename?);
/* direct link
else
$out .= sprintf('<li><a href="%s&_part=%s&_frame=1" target="rcubemailattachment">%s</a></li>'."\n",
*/
}
$out .= "</ul>";
return $out;
}
[REPLACE FOR]
function rcmail_message_attachments($attrib)
{
global $CONFIG, $OUTPUT, $PRINT_MODE, $MESSAGE, $GET_URL, $JS_OBJECT_NAME;
if (sizeof($MESSAGEattachments?))
{
allow the following attributes to be added to the <ul> tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
$out = '<ul' . $attrib_str . ">\n";
foreach ($MESSAGEattachments? as $attach_prop)
{
if ($PRINT_MODE)
$out .= sprintf('<li>%s (%s)</li>'."\n",
else
$out .= sprintf('<li><a href="%s&_part=%s&_frame=1" target="rcubemailattachment">%s</a></li>'."\n",
/* direct link
else
$out .= sprintf('<li><a href="%s&_part=%s&_frame=1" target="rcubemailattachment">%s</a></li>'."\n",
*/
}
$out .= "</ul>";
return $out;
}
}
Baseline: Force to open the attachment in the "FRAMED-THING" with no frame, and use the [DOWNLOAD] control.
PS:Sorry for my bad english :P
I hope help someone, and i love this round cube, deserves all from god.
Core, out [[]]
comment:3 Changed 7 years ago by thomasb
- Resolution set to fixed
- Status changed from reopened to closed
Attachment naming should be fixed in Trunk. There was also a bug with incorrect Content-Length header that could have caused download problems.

I have a fix I am satisfied with.
Roundcube tries to 'inline' certain content (PDF's, flash, jpeg's...), and in my case, that just was not working. I was getting the above problem. So I modified program/js/app.js and removed "application/pdf" so RC no longer sees PDF's as anything special, and downloads them as per normal. I consider this a 'fix' for me, but it would be nice to have inlining working. If someone else wants to try a kick at the can, I am willing to be a guinea pig.