Dividing a file before to download it

Discussion in 'Javascript' started by sc48567189@hotmail.com, Nov 18, 2005.

  1. Guest

    Hello ! I need some help here. I google after the response but with no
    sucess.
    I need to download - randon size - parts of a file, not the whole file.
    Says: I have the zip file test.zip, it is 10 mega bytes long. But I
    don't want the 10 mega today. Today I want 5 mega bytes. Tomorrow I
    could want more 3 mega bytes of the file, but it is not sure, could be
    4 mega bytes. I need to part the zip file in chunks at request. No CGI,
    no asp, no php. Only client side scripts. Any help will be apreciated.
    PFMBE (Please forgive my broken english).
     
    , Nov 18, 2005
    #1
    1. Advertising

  2. > I need to download - randon size - parts of a file, not the whole file.

    You can not do this... especially not on a zip file. You can stop your
    download partway through but then you will only have the first however
    many bytes. Downloads are not random access media.

    > Please forgive my broken english


    It is better than most native English speakers on the internet! :)
     
    Joshie Surber, Nov 18, 2005
    #2
    1. Advertising

  3. Joshie Surber wrote:
    ^^^^^^^^^^^^^
    Please provide attribution.
    vvvvvvvvvvvvvvvvvvvvvvvvvvv
    >> I need to download - randon size - parts of a file, not the whole file.

    >
    > You can not do this... especially not on a zip file.


    Not true.

    > You can stop your download partway through but then you will only have
    > the first however many bytes. Downloads are not random access media.


    However, for example most FTP servers and clients provide means of
    resume which is essentially random access to that file resource.
    (To be at least a bit on-topic:)

    ---------------------------------------------------------------------------
    $ ftp -aachen.de
    Connected to sunsite.informatik.rwth-aachen.de.
    220 Welcome to SunSITE CEUR
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> cd /pub/mirror/eclipse/S-3.2M3-200511021600
    250 Directory successfully changed.
    ftp> get eclipse-platform-3.2M3-linux-gtk.tar.gz
    local: eclipse-platform-3.2M3-linux-gtk.tar.gz remote:
    eclipse-platform-3.2M3-linux-gtk.tar.gz
    229 Entering Extended Passive Mode (|||57355|)
    150 Opening BINARY mode data connection for
    eclipse-platform-3.2M3-linux-gtk.tar.gz (29718549 bytes).
    27% |********* | 7836 KB 711.73 KB/s 00:29
    ETA
    receive aborted. Waiting for remote to finish abort.
    426 Failure writing network stream.
    226 ABOR successful.
    8130784 bytes received in 00:11 (696.60 KB/s)
    ftp> ^D
    221 Goodbye.
    ftp> open sunsite.informatik.rwth-aachen.de
    Connected to sunsite.informatik.rwth-aachen.de.
    220 Welcome to SunSITE CEUR
    Name (sunsite.informatik.rwth-aachen.de:pelinux): anonymous
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> cd /pub/mirror/eclipse/S-3.2M3-200511021600
    250 Directory successfully changed.
    ftp> restart 8130784
    Restarting at 8130784 for next get, put or append
    ftp> get eclipse-platform-3.2M3-linux-gtk.tar.gz
    local: eclipse-platform-3.2M3-linux-gtk.tar.gz remote:
    eclipse-platform-3.2M3-linux-gtk.tar.gz
    229 Entering Extended Passive Mode (|||45064|)
    350 Restart position accepted (8130784).
    150 Opening BINARY mode data connection for
    eclipse-platform-3.2M3-linux-gtk.tar.gz (29718549 bytes).
    100% |*************************************| 29022 KB 714.23 KB/s 00:00
    ETA
    226 File send OK.
    21587765 bytes received in 00:29 (714.22 KB/s)
    ftp> ^D
    221 Goodbye.
    ---------------------------------------------------------------------------

    The OP's problem is best addressed with a download tool such as an
    FTP client, not JS/ECMAScript.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Nov 18, 2005
    #3
  4. Guest

    Thomas 'PointedEars' Lahn escreveu:

    > Joshie Surber wrote:
    > ^^^^^^^^^^^^^
    > Please provide attribution.
    > vvvvvvvvvvvvvvvvvvvvvvvvvvv
    > >> I need to download - randon size - parts of a file, not the whole file.

    > >
    > > You can not do this... especially not on a zip file.


    What about a big jpg, I mean a big jpg map ?
    >
    > Not true.
    >
    > > You can stop your download partway through but then you will only have
    > > the first however many bytes. Downloads are not random access media.

    >


    I know it is possible using XMLHTTP, but I don't know the way to send
    the requests.

    Thank you all replies .
     
    , Nov 19, 2005
    #4
  5. wrote:

    > Thomas 'PointedEars' Lahn escreveu:
    >> Joshie Surber wrote:
    >> >> I need to download - randon size - parts of a file, not the whole
    >> >> file.
    >> > You can not do this... especially not on a zip file.

    >
    > What about a big jpg, I mean a big jpg map ?


    The file format does not matter. Regarding download, everything is a byte
    (bit-octet) stream.

    >> Not true.


    Did you read this in context?

    >> > You can stop your download partway through but then you will only have
    >> > the first however many bytes. Downloads are not random access media.

    >
    > I know it is possible using XMLHTTP, but I don't know the way to send
    > the requests.


    Although I doubt that can be accomplished via HTTP:

    Which requests do you want to send, precisely?


    PointedEars
     
    Thomas 'PointedEars' Lahn, Nov 19, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve

    Dividing a clock

    Steve, Jan 1, 2004, in forum: VHDL
    Replies:
    0
    Views:
    1,624
    Steve
    Jan 1, 2004
  2. kwaj

    Dividing Real Numbers?

    kwaj, Feb 9, 2004, in forum: VHDL
    Replies:
    2
    Views:
    1,229
  3. =?Utf-8?B?cm9kY2hhcg==?=

    dividing numbers

    =?Utf-8?B?cm9kY2hhcg==?=, Jun 28, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    469
    =?Utf-8?B?cm9kY2hhcg==?=
    Jun 28, 2005
  4. M. Akkerman
    Replies:
    5
    Views:
    387
    Jeff Schwab
    Dec 14, 2003
  5. James Colannino

    Regular Expressions and Dividing Strings

    James Colannino, Nov 8, 2005, in forum: Python
    Replies:
    0
    Views:
    339
    James Colannino
    Nov 8, 2005
Loading...

Share This Page