473,785 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help about download large files

Hi guys,
I wrote a little script to authorize the users to download a file
without showing the actual location of the file.

I wrote something like

if(authorized) {
$file_path = "$site_path " . "/anAbsolute/pathTo/MyFile.zip";

$file_mime = "applicatio n/x-zip-compressed";
$file_name = "new_name.z ip";

header("Content-Type: application/x-zip-compressed)
header("Content-Transfer-Encoding: binary");
header("Content-Length: ". filesize($file_ path));
header("Content-Disposition: inline; filename=".$fil e_name);
header("Expires : 0");
header("Cache-Control: no-cache, must-revalidate");
header("Cache-Control: private");
header("Pragma: public");
readfile($file_ path);
}

this works perfectly for most of the files. But I can't use it because:

* MyFile.zip size is around 300 mb.

* max_time_limit on the server is around 2 minutes, while the script
would need more time to complete the task.

* I cannot override max_time_limit because i'm hosted and it's forbidden.

Is there any other way to achieve this goal?
Thanks for your help
Francesco

Nov 2 '07 #1
1 2140

"Francesco" <fl**@tluk.itwr ote in message
news:47******** **************@ reader4.news.ti n.it...
Hi guys,
I wrote a little script to authorize the users to download a file without
showing the actual location of the file.

I wrote something like

if(authorized) {
$file_path = "$site_path " . "/anAbsolute/pathTo/MyFile.zip";

$file_mime = "applicatio n/x-zip-compressed";
$file_name = "new_name.z ip";

header("Content-Type: application/x-zip-compressed)
header("Content-Transfer-Encoding: binary");
header("Content-Length: ". filesize($file_ path));
header("Content-Disposition: inline; filename=".$fil e_name);
header("Expires : 0");
header("Cache-Control: no-cache, must-revalidate");
header("Cache-Control: private");
header("Pragma: public");
readfile($file_ path);
}

this works perfectly for most of the files. But I can't use it because:

* MyFile.zip size is around 300 mb.

* max_time_limit on the server is around 2 minutes, while the script would
need more time to complete the task.

* I cannot override max_time_limit because i'm hosted and it's forbidden.

Is there any other way to achieve this goal?
Yeah - there's supposed to be something in the content type or
transfer-encoding about "multi-part binary".

HTTP wasn't meant to transfer binaries, so an http session isn't long enough
for much more than a LOT of text.
By doing the "multi-part binary" thing, you're letting the browser/server
auto-negotiate a whole buncha http transactions, each sending a chunk of the
file until the whole thing is complete.

Nov 2 '07 #2

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

Similar topics

6
2893
by: Jozef | last post by:
Hello, First off, let me say that I DO own XP Developers edition, so I do have a license to distribute the runtime. What I'm looking for is the bare bones files I need to deploy a runtime version of Access. When I use the Package and Deployment wizard, the resulting set up file is 160 Mb in size. I'd like to just package the program database and the bare minimum files needed for it to run properly. Any help would be greatly...
1
1837
by: Al Cadalzo | last post by:
I have a web page that allows a user to download data by clicking on a link button. I then use Aspose.Excel (v1.0.3705) to generate the file for download and then I call the "Save" method on the Aspose.Excel object to send it to the Response object. One of our users has Norton Firewall installed and when he tries to download a large amount of data he gets a message ""0 bytes downloaded". It works OK with smaller files. When he disables...
12
1430
by: Jerry Camel | last post by:
I thought I had finally figured out how to control the downloads from my page. I was having issues with large files, but after much research I came up with the following code. The download seems to proceed without issue, but never terminiates. The byte count stops incrementing, but the dowload dialog never closes. (Until I hit cancel.) What's keeping the download from ending properly? I'm pretty close to finishing this app - any help is...
3
1699
by: RC | last post by:
Dear Dudes, I post this in multiple groups for opening brain storm. Sometime I need to query the data from database server then display them into user's browser in HTML <table>. But if the <table> is very LARGE, let's say 20 columns, hundreds rows. Usually you have header <th> tags on 1st (top) row and 1st (most left) column. For a such LARGE <table>. you really want:
6
2504
by: Mudcat | last post by:
Hi, I am trying to build a tool that analyzes stock data. Therefore I am going to download and store quite a vast amount of it. Just for a general number - assuming there are about 7000 listed stocks on the two major markets plus some extras, 255 tradying days a year for 20 years, that is about 36 million entries. Obviously a database is a logical choice for that. However I've never used one, nor do I know what benefits I would get...
15
4644
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
46
2542
by: Bruce W. Darby | last post by:
This will be my very first VB.Net application and it's pretty simple. But I've got a snag in my syntax somewhere. Was hoping that someone could point me in the right direction. The history: My work involves creating custom packages of our software product for golf courses that purchase our software. The course data is kept as a back up in the event the course needs us to replace their custom files. Each course has a folder of it's own...
20
4287
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
2
1498
by: Joey | last post by:
I have written an app in C#/asp.net 2.0 that is a system built to handle a large number of scenarios. Part of that system involves allowing users to download large files. As part of my original design strategy, I chose to locate these downloads in a directory separate from the website file structure. The two primary purposes for this were: (1) it is more secure because users cannot link directly to the files and (2) it is modular,...
0
9647
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
9489
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
10356
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
9959
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...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.