Jump to content

Save File


Dysan

Recommended Posts

Not sure if this works in 'all' browsers, but at least in Firefox and IE7:

 

<?php
$filename = 'sometrack.mp3';
header('Content-type: audio/mpeg');
header('Content-Disposition: attachment; filename="'.$filename.'"');
//contents of file starts here (well, first when you start echoing)
$f = fopen("Upload/".$row['Path'], "rb");
$trash = fread($f, 2488320);
echo fread($f, 245760);
$trash = null ;
fclose($f);
?>

 

If this isn't good enough for you, have a look at this thread. :)

Link to comment
https://forums.phpfreaks.com/topic/77848-save-file/#findComment-394042
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.