resume downloads

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    resume downloads

    I want send my zip files in my page from inside php.
    With this I know how many people have download my file and other information.

    My problem is this, I have this code but it dosn't resume broken downloads.
    What I can do for this?
    -------------------
    <?php
    header('Content-type: application/zip');

    $fp = fopen('file.zip ', 'rb');
    while (!feof($fp))
    echo fread($fp, 1024);
    fclose($fp);
    ?>
    ---------------------


  • R. Rajesh Jeba Anbiah

    #2
    Re: resume downloads

    "<- Chameleon ->" <cham_gss@hotma il.NOSPAM.com> wrote in message news:<bn1jlc$lp 4$1@nic.grnet.g r>...[color=blue]
    > I want send my zip files in my page from inside php.
    > With this I know how many people have download my file and other information.
    >
    > My problem is this, I have this code but it dosn't resume broken downloads.
    > What I can do for this?
    > -------------------
    > <?php
    > header('Content-type: application/zip');
    >
    > $fp = fopen('file.zip ', 'rb');
    > while (!feof($fp))
    > echo fread($fp, 1024);
    > fclose($fp);
    > ?>
    > ---------------------[/color]

    This won't work for resume download. You need to parse the
    request header of the download manager (HTTP_RANGE) and echo only that
    range using fseek or something. Also you need to send the proper
    header
    (ie, something like header('Content-Range: bytes 0-200/1024'))

    You may even get nice PHP script by Googling.

    ---
    "US got a nuclear bomb that can destroy the world 13 times. Russia
    got a nuclear bomb that can destroy the world 7 times. But...my
    friend! Tell me! CAN YOU KILL A MAN TWICE??!!!!!" -- P.A.Sangma, Peace
    loving Indian politician against India's step to go for a nuclear
    test.
    Email: rrjanbiah-at-Y!com

    Comment

    • Guest's Avatar

      #3
      Re: resume downloads

      > > I want send my zip files in my page from inside php.[color=blue][color=green]
      > > With this I know how many people have download my file and other information.
      > >
      > > My problem is this, I have this code but it dosn't resume broken downloads.
      > > What I can do for this?
      > > -------------------
      > > <?php
      > > header('Content-type: application/zip');
      > >
      > > $fp = fopen('file.zip ', 'rb');
      > > while (!feof($fp))
      > > echo fread($fp, 1024);
      > > fclose($fp);
      > > ?>
      > > ---------------------[/color]
      >
      > This won't work for resume download. You need to parse the
      > request header of the download manager (HTTP_RANGE) and echo only that
      > range using fseek or something. Also you need to send the proper
      > header
      > (ie, something like header('Content-Range: bytes 0-200/1024'))[/color]

      Thank you friend. The key-word was "Content-Range" in Google...
      Because html headers does many usefull things (I see this now ;-), where can I found a reference to all possible html headers?

      thank you again


      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: resume downloads

        "<- Chameleon ->" <cham_gss@hotma il.NOSPAM.com> wrote in message news:<bn3b9h$1e 0$1@nic.grnet.g r>...[color=blue]
        >
        > Thank you friend. The key-word was "Content-Range" in Google...
        > Because html headers does many usefull things (I see this now ;-), where can
        >I found a reference to all possible html headers?[/color]

        Sorry, I don't know. I have 2 links for MIME



        The second link which doesn't work now was cool. It had some
        downloadable zip file.

        ---
        "If there is a God, he must be a sadist!"
        Email: rrjanbiah-at-Y!com

        Comment

        • Eric Veltman

          #5
          Re: resume downloads

          Hello,

          "<- Chameleon ->" <cham_gss@hotma il.NOSPAM.com> wrote in message
          [color=blue]
          > Because html headers does many usefull things (I see this now ;-), where can I found a reference to all possible html headers?[/color]

          http://www.w3.org/Protocols/rfc2616/rfc2616.txt describes most of them.

          Best regards,

          Eric

          Comment

          Working...