I have created a Module to make blob file available for Download in Drupal 7 .
Below my code for .module file
<?php function blobfile_block_info() { $blocks = array(); $blocks['blobfile_block'] = array( 'info' => t('Blob Files Download'), ); return $blocks; } function blobfile_block_view($delta) { $query = db_select('health_policy_document_upload_dtl', h)->fields('h'); $result = $query->execute(); $content =''; while($record = $result->fetchAssoc()) { $filename = $record['Document_Name']; $file = $record['Document']; $type = $record['Document_Type']; $size = filesize($file); header("Content-length: $size"); header("Content-type: $type"); header("Content-Disposition: attachment; filename=$filename"); $content .= "<a href='#'>".$filename."</a>"; $content .= "<br>"; } return array( 'subject' => t('Bids'), 'content' => $content ); }
Please guide me where I went wrong.
Sponsored by SupremePR