When adding an attachment to a newsletter issue, the link that is displayed in the received email contains the size number or the attachment. Example. http://www.drupal.org/sites/files/document.pdf45 KB. Just an example, but the number is included in the link. The newsletter was sent in plain text format.

Comments

sutharsan’s picture

Status: Active » Closed (won't fix)

This html:

<tr class="odd"><td><a href="http://example.com/files/attachment.txt">attachment.txt</a></td><td>698 bytes</td> </tr>

Is converted to:

http://example.com/files/attachment.txt698 bytes

I see no general rule to apply which prevents this from happening. I advise you to theme the attachment and add a space in front of the number of bytes.

ao2’s picture

Hi I resolved by theming the attachment table so that the size isn't shown at all.

Put this in upload_attachments.tpl.php into your theme directory and refresh the theme list:

/**
 * Themed attachments table
 */
  $header = array(t('Attachment'));
  $rows = array();
  foreach ($files as $file) {
    if ($file->list) {

      $text = check_plain($file->description ? $file->description : $file->filename);
      $path = check_url(($file->fid ? file_create_url($file->filepath) : url(file_create_filename($file->filename, file_create_path()))));

      $row = array('data' => l($text, $path, array($absolute = FALSE, $html = TRUE))); 
      $rows[] = array($row);
    }
  }

  if (count($rows)) {
    print '<div class="attachments">'. theme('table', $header, $rows, array('class' => 'attachments')) .'</div>';
  }