Hello, I've been looking and trying a lot of things but I cant find a solution to this problem. Here it is the scenario, Im building a big tar file (about 70~100 Mb) on the fly, mainly fetching information from a MySQL DB and from other raw files of my own. The output file is very redundant so I want to encode it as gz to make it lighter.
The problem is this: The only way I came to encode it is using the php function gzencode, however I have first to build the tar file (I'm building it using Output Buffering) to pass the data to the encoding function. The process of building the tar file takes time, and no output is generated durating this time, so the "Save As..." Dialog doesn't show up until the output is started (As I stated, after building and gzipping the tar file).
Does anybody knows a way to tell the client that we are going to send a file but maybe we will delay to start delivering content?
Or there is a way to gzip chunks of data inside a gzip file?
Thanks in advance, and please excuse me for my bad English.
3 1978 pbmods 5,821
Recognized Expert Expert
Heya, Zlash.
Check out flush().
Thanks for your reply, but is not what im needing.
I dont have problem with the output buffering, is just that for gzipping the content, I must have all the file proccesed. While Im doing it, the "Download As" dialog will not appear. This is frustrating for users, as they think that download is not working. What Im looking for is a way to tell the web browser to present the dialog, even if we are not going to send data inmediately.
My current solution, is to start the tar structure, and put on it a file with only a space, this shows the dialog to the user. Then I include the tar.gz file inside the tar.
It """""works"""" but I dont like it. Its not clean, and Im sure that there is a better way to do it. Also, I waste a couple of NULL characters that should be compressed too.
Thanks again for your reply.
pbmods 5,821
Recognized Expert Expert
Heya, Zlash.
You might want to create a download queuing system, where the User puts in his request to download the file, and then a window opens with an estimate of how long it will take to prepare the download. The window would refresh once a minute or so and present the User with a download link once the package was ready for download.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jim Hubbard |
last post by:
I went to the compression newsgroups, but all I saw was spam. So, I
thought I'd post his question here to get the best info I could from other
programmers.
Which compression algorithm offers...
|
by: Maurice Mertens |
last post by:
Hello,
I'm having troubles with saving a tiff-file with a certain compression
and colordepth. This is the code I use:
----------------------------------------------------------------------...
|
by: Anurag |
last post by:
Hi,
I am told that Oracle has this "data compression" feature that allows
you to store online data ina compressed format.
This is different from archived data - you compress only that data
which...
|
by: deko |
last post by:
Is it best practice to set Unicode Compression to "No" for memo fields in a
table? What about text fields?
According to the VB help entry:
"Data in a Memo field is not compressed unless it...
|
by: dunric |
last post by:
After writing the computing urban legend "The Helsinki Code",
I spent several nights thinking up how in the world Gustav
Larsson, the Finnish PDP-8 computer programmer, could have
managed to...
| |
by: chris.atlee |
last post by:
I'm writing a program in python that creates tar files of a certain
maximum size (to fit onto CD/DVD). One of the problems I'm running
into is that when using compression, it's pretty much...
|
by: Benny Ng |
last post by:
Dear All,
Now I met some performance problems in my application. Because according
to our business. The size of some web forms are larger than 1xxx MB. So it
takes a long time for user opening a...
|
by: chance |
last post by:
Hello,
I want to add compression to a memory stream and save it in an Oracle
database. This is the code I have so far:
//save the Word document to a binary field,
MemoryStream dataStream = new...
|
by: =?Utf-8?B?VkJB?= |
last post by:
I compressed a file with GZipStream class and is larger than the original
file.... how can this be?, the original file is 737 KB and the "compressed"
file is 1.1 MB. Did i miss something or is...
|
by: GiJeet |
last post by:
Hello, we have an app that scans documents into TIFF format and we
need to transfer them over the internet. If anyone knows of a SDK we
can use that can compress TIFFs on the fly or even if it can...
|
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...
| |
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: 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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |