473,659 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8569
"<- Chameleon ->" <ch******@hotma il.NOSPAM.com> wrote in message news:<bn******* ***@nic.grnet.g r>...
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******@hotma il.NOSPAM.com> wrote in message news:<bn******* ***@nic.grnet.g r>...

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******@hotma il.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
7340
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; but no result ;-( Please Help!
2
3524
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 have a background in both hardware and software. I want to create an application that will regenerate a resume from the XML Resume that I have. I would like some people to look over my XML Resume data and give me suggestions on the XML. This...
0
3037
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 cPanel URL that delivers a gzipped copy of the log file with all entires for the current month (up to the current date and time). I want to run this script once a day (at night) and would like to download the gzipped file by resuming from where...
2
6797
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 you are debugging within IDE...? Here is an example from VB: Private SomeFunction () On Error GoTo ErrHandler: MyMethod this, that
4
2423
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
27415
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 message from Access. If I comment out the 1st On Error Resume Next and the x = 1 / 0 on the next line there is no difference, i.e. ther same unhandled error on the same line. I included these 2 lines of code to demonstrate that On Error Resume Next...
7
21932
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
2445
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 = -1) { @$a = filesize($file); if ($offset2 <= $offset || $offset2 < 1) $offset2 = $a - 1; if ($offset2 <= $offset || $offset < 0) $offset = 0; header("Content-Range: bytes $offset-$offset2/$a");
0
20254
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 Information: Include your name (on every page), phone number, email, address, and postal code. Objective: Address the positions that you are currently seeking. Highlights: 5 or 6 points summarizing your career skills and abilities. Work Experience: Be...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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...
0
8747
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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
7356
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
5649
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();...
1
2752
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
1737
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.