469,592 Members | 1,909 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Dividing a file before to download it

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 23 '05 #1
5 1441
> 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! :-)

Nov 23 '05 #2
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 an*******@sunsite.informatik.rwth-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
Nov 23 '05 #3
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 23 '05 #4
sc********@hotmail.com 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
Nov 23 '05 #5
On 2005-11-18, Joshie Surber <jo**********@gmail.com> 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. You can stop your
download partway through but then you will only have the first however
many bytes. Downloads are not random access media.


It's possible, partial, and resumed, downloads are supported by the
HTTP protocol. things like wget (linux) and getRight (windows) do
this well. but it may not be possible using javascript.

Bye.
Jasen
Nov 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

65 posts views Thread by Pmb | last post: by
reply views Thread by Buddy Ackerman | last post: by
3 posts views Thread by tshad | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.