473,388 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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);
?>
---------------------
Jul 17 '05 #1
4 8553
"<- Chameleon ->" <ch******@hotmail.NOSPAM.com> wrote in message news:<bn**********@nic.grnet.gr>...
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);
?>
---------------------


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
Jul 17 '05 #2
> > 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);
?>
---------------------


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'))


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
Jul 17 '05 #3
"<- Chameleon ->" <ch******@hotmail.NOSPAM.com> wrote in message news:<bn**********@nic.grnet.gr>...

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?


Sorry, I don't know. I have 2 links for MIME
http://www.w3schools.com/media/media_mimeref.asp
http://fedb.digitalrice.com/

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
Jul 17 '05 #4
Hello,

"<- Chameleon ->" <ch******@hotmail.NOSPAM.com> wrote in message
Because html headers does many usefull things (I see this now ;-), where can I found a reference to all possible html headers?


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

Best regards,

Eric
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: | last post by:
Well, I read RFC, but I have a problem now: How can I get the HTTP_RANGE enviroment variable from client to resume a download? (GetRight) I try $http_range = $_ENV; $http_range = $_COOKIE;...
2
by: Ian DeRock | last post by:
I'm fairly new to XML. As I can see it, XML is a way to organize data like in a table in a RDB, or the RDB itself. I have used XML in application data, but did not design the actual XML. I...
0
by: Chuck Anderson | last post by:
I am writing a Php script to run on my home PC (Windows) that downloads an Apache access log file and inserts new entries into a database.. The only way I can access these log files is through a...
2
by: Darta | last post by:
OK- I volunteer to be shot if this question is stupid... BUT, is there a way to, when you catch an exception in the catch{} handler, resume to the same line of code that generated an error while...
4
by: Crouchie1998 | last post by:
How do I download a file & resume from where it left off at a later time/date? Any ideas?
3
by: bob.needler | last post by:
I know On Error Resume Next is generally considered lazy. But can someone tell me why the resume next in Exit_Handler does not seem to work? It generates the typical unhandled runtime error...
7
by: fniles | last post by:
In VB 6.0 in the error trapping, we can do "resume next" to continue on the next code. How can we do that in .NET with "Try", "Catch","End Try" ? Thanks
1
by: Chameleon | last post by:
I want to send a static file, via php to browser with ability to resume download. This is the code: -------------------------------------------- function send_file($file, $offset = 0, $offset2 =...
0
MMcCarthy
by: MMcCarthy | last post by:
Organizing a Resume Pertinent information included on your resume may be organized in a variety of ways. Regardless of the type of resume used, you should include the following: Contact...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.