alco19357 Posted June 24, 2009 Share Posted June 24, 2009 I have a system that reads a file (.dat) and will render it as an wmv. Code below: function download($VAR) { $db = &DB(); $sql = 'SELECT * FROM ' . AGILE_DB_PREFIX . 'file WHERE site_id = ' . DEFAULT_SITE . ' AND id = ' . $db->qstr(@$VAR['id']) . ' AND status = 1'; $result = $db->Execute($sql); if($result->RecordCount() == 1) { $show = true; ### Validate start date $s = $result->fields['date_start']; if($s != '' && $s != 0) if($s > time()) $show = false; ### Validate expire date $e = $result->fields['date_expire']; if($e != '' && $e != 0) if($e < time()) $show = false; ### Validate user group: if($show) { global $C_auth; @$arr = unserialize($result->fields['group_avail']); $show = false; for($i=0; $i<count($arr); $i++) { if($C_auth->auth_group_by_id($arr[$i])) { $show = true; break; } } } ### Get the filetype if($show) { $ft = $result->fields['location_type']; if($ft == 0) $file = PATH_FILES . 'file_'.$VAR['id'].'.dat'; elseif ($ft == 1) $file = $result->fields['location']; elseif ($ft == 2) $file = $result->fields['location']; ### Open the file if (@$file=fopen($file, 'r')) { ### Display the correct headers: header ("Content-Type: " . $result->fields['type']); header ("Content-Size: " . $result->fields['size']); header ("Content-Disposition: inline; filename=mylbpr.wmv"); header ("Content-Length: " . $result->fields['size']); fpassthru($file); exit; } } } echo 'Sorry, the file does not exist or you are not authorized or your access has expired!'; } When I play the page in Internet Explorer, it works with both attachment and inline as my disposition. However, in Firefox, it only works when the disposition is attachment. I can't get the file to play inline, nor can I get the file to play as an embed. Please help. Thank you!! Alex this is from the Agile Billing software Quote Link to comment Share on other sites More sharing options...
alco19357 Posted June 24, 2009 Author Share Posted June 24, 2009 also, i'm using firefox with the Microsoft Windows Media Player Firefox Plugin enabled. When i disable the plugin, and try, it does downloads the wmv to my local and it works from there. Does anyone know if there are settings i have to change in the plugin or is there another plugin for vista out there? Thank you! Alex Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.