Dividing a file before to download it

S

sc48567189

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).
 
J

Joshie Surber

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! :)
 
T

Thomas 'PointedEars' Lahn

Joshie Surber wrote:
^^^^^^^^^^^^^
Please provide attribution.
vvvvvvvvvvvvvvvvvvvvvvvvvvv
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 (e-mail address removed)-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
 
S

sc48567189

Thomas 'PointedEars' Lahn escreveu:
Joshie Surber wrote:
^^^^^^^^^^^^^
Please provide attribution.
vvvvvvvvvvvvvvvvvvvvvvvvvvv

What about a big jpg, I mean a big jpg map ?
Not true.

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

Thank you all replies .
 
T

Thomas 'PointedEars' Lahn

Thomas 'PointedEars' Lahn escreveu:

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.

Did you read this in context?
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top