You are here

function uploadfield_file_download in Video 6.4

Same name and namespace in other branches
  1. 6.3 types/uploadfield/uploadfield.module \uploadfield_file_download()

Implementation of hook_file_download.

File

types/uploadfield/uploadfield.module, line 61

Code

function uploadfield_file_download($filepath) {

  // Return headers for default images.
  if (strpos($filepath, 'video_thumbs') !== FALSE) {
    $full_path = file_create_path($filepath);
    if ($info = getimagesize($full_path)) {
      return array(
        'Content-Type: ' . $info['mime'],
        'Content-Length: ' . filesize($full_path),
      );
    }
  }
}