You are here

function _emthumb_preview in Embedded Media Field 5

transfer a file that is in a 'preview' state. @todo multiple support

1 string reference to '_emthumb_preview'
emthumb_menu in contrib/emthumb/emthumb.module

File

contrib/emthumb/emthumb.module, line 29

Code

function _emthumb_preview() {
  foreach ($_SESSION['emthumb'] as $fieldname => $files) {
    foreach ($files as $delta => $file) {
      if ($file['preview'] == $_GET['q']) {
        file_transfer($file['filepath'], array(
          'Content-Type: ' . mime_header_encode($file['filemime']),
          'Content-Length: ' . $file['filesize'],
        ));
        exit;
      }
    }
  }
}