Jump to content

Recommended Posts

Hi all.

 

Hope you can help me.

 

I have created a small php script that serves up a file to be downloaded, this works fine however, the estimated time left to download is unknown and i assume this is due to my script no containing the file size for web browsers to calculate the eta.

 

Can anyone help me with this?

 

its just a PDF of about 30MB but is important that those who download know the ETA.

 

many thanks.

Link to comment
https://forums.phpfreaks.com/topic/263995-php-file-server-download/
Share on other sites

Thanks for the info, im quite new to php so could you please explain how i enter in file size values and where i should enter it?

 

this is my current script to serve the file (2012.pdf)

whet should i add the extra line, my file size is 15.226KB, how do i translate this into the correct content length?

 

<?php

header('Content-disposition: attachment; filename=2012.pdf');

header('Content-type: application/pdf');

readfile('2012.pdf');

?>[/blockquote>

 

thanks again.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.