Jump to content

billgates2000

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

billgates2000's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have uploaded my mp3 collection on my webserver, but in a folder below the published directory so that it cannot be accessed from the web. However, I would like my friends to be able to download a small part of an mp3 file they request (say, 10%). I found the following script which does the job, i.e. it sends a file from the webserver to the browser: // Demo - send a (binary) file $file = "ireland.jpg"; $fp = fopen($file,"r") ; header("Content-Type: image/jpeg"); while (! feof($fp)) { $buff = fread($fp,4096); print $buff; } My question is, how can this script be modified so that: 1. It calculates the total size of the file to be send, and 2. Send only 10% of the filesize to the browser. I have done this in ASP it was really easy, but now I'm moving my site to PHP and I'm really not familliar with this. Thanks a lot.
×
×
  • 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.