Track downloads' status


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

I need to make somehow, some system, to track whether downloads are completed or failed. I tried to make this via php.

Tried to limit the connection speed for smaller downloads (to have the time to detect a cancel) (+ ignore_user_abort(true)) in a while where i also checked the connection_status.

/* dl headers */
ignore_user_abort(true);
while(feof($f))
{
echo fread($f,5*1024); /* 5 kb/s */
flush();
sleep(1);
if (connection_status()!=0)
exit();
}
/* track after the download */

Well it doesn't work because the browsers are waiting for script execution to end before popping-up the download dialog. So the users waits like 20-30 seconds, then the download dialog pops, and instantly saves the file.

So, probably the only solution is something to intermediate the download. If you know some Java/../.. component which can do this (no matter free or payed) would be nice.

Or maybe, somebody knows a way to do this from php.


Thank you

No comments posted yet

Your Answer:

Login to answer
160 Like 13 Dislike
Previous forums Next forums
Other forums

Is it possible to put an entire 500-page book in a database with PHP?
I am working on an intranet and I was wondering if its possible to code php with mysql to enter a fu

FILTER_CALLBACK -- Files?
Hi All,

I'm using the php filter functions to validate my form data. For custom filters, I'm

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

strptime() equivalent for php4 ?!
Greetings!

this is my first post, thank you in advance for your replies.

Well, the ti

Setting/Modify Headers using mail() function
I have a question about setting email headers when using mail() in a php script.

When I send

GMail like Chat in ASP.NET
Hi,Can anyone suggest me, how to incorporate GMail like chat in my existing ASP.Net application.I wa

Preventing blank or already entered values
Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLAN

NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder '

Final year project, please point me in the right direction
hi there for my final year project I'm aiming to build a php script shell to use as an expert system

Question about the upload of large files
Hi there,

I have a question about the upload of large files, like videos (files generally abo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash