473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1578
> 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.
vvvvvvvvvvvvvvv vvvvvvvvvvvv
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*******@sunsi te.informatik.r wth-aachen.de
Connected to sunsite.informa tik.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.informa tik.rwth-aachen.de
Connected to sunsite.informa tik.rwth-aachen.de.
220 Welcome to SunSITE CEUR
Name (sunsite.inform atik.rwth-aachen.de:pelin ux): 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.
vvvvvvvvvvvvvvv vvvvvvvvvvvv
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********@hotm ail.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**********@g mail.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6113
by: Brandon Walters | last post by:
I wrote a file download module for my website. The reason for the file download module is that my website downloads work on a credit based system. So I need to keep track of and limit daily downloads. It uses fpassthru() and some headers() to send a file to the requesting user. The get.php file that I wrote (the file download module if you will) works like a charm for .ZIP files and .TXT files. However, when .EXE files are downloaded...
65
4051
by: Pmb | last post by:
I'm confused as to what the compiler error message I'm getting is refering to. Can someone take a gander and let me know what I did wrong? The program is below. When I compile it I get the following error ______________________________ Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland d:\temp\complex\temp.cpp: Error E2333 d:\temp\complex\temp.cpp 73: Class member 'Complex::conjugate(Complex)' declared outside its class Error...
0
1826
by: Buddy Ackerman | last post by:
I am trying to implment a file download via a link such that when clicked, instead of starting the default application for that type of file the user will be presented with a download dialog window. Well, thanks to Steve Orr, I have that working. However, I still have a few issues. First, the download dialog does not have the name of the file being downloaded in the "File name" field, instead it has the name of the aspx page that have...
1
5377
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
0
1736
by: Rhys666 | last post by:
Basically I have a link that opens my download page and the querystring identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring, identifies the template required then uses Response.AppendHeader to amend the response to create the file download dialogue. On my local machine this works fine and the download dialogue correctly identifies the file name and type attempting to be...
3
2132
by: tshad | last post by:
I have a function that downloads a file to the users computer and it works fine. The problem is that I then want the program to rename the file (file.move) to the same name plus todays date. The problem is that when you run the program it gets to the: Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name)
16
3244
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will not print in the username or email amddress of the person doing the download - which I am collecting from a form on the previous page. I can get the name and email address to print out normally, just not into the email sending body. I have...
4
2417
by: Roberto Mora | last post by:
I have not done programming in a very long time and what is worst, I never learned VB. Although my job does not require this knowledge, I cam across a problem that although it seemed simple it has become a nightmare. There is a log that gets generated in a regular basis and need to put most , but not all its contents in a DB (new or existent, it doesn't matter). because the fields that I need to cover are vertically and there is junk in...
1
47445
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.