function _filefield_preview in FileField 5
Same name and namespace in other branches
- 5.2 filefield.module \_filefield_preview()
transfer a file that is in a 'preview' state. @todo multiple support
1 string reference to '_filefield_preview'
- filefield_menu in ./
filefield.module - @file Defines a file field type.
File
- ./
filefield.module, line 39 - Defines a file field type.
Code
function _filefield_preview() {
foreach ($_SESSION['filefield'] 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;
}
}
}
}