Forum Moderators: open
[evergladesplan.org...]
File Size Guidelines:
< 1 mb (1000 kb) preferred
1-2 mb's – ok for a really big file
3-4 mb's – the maximum recommended for the web
5 mb's – really too large for the web (should be split into smaller files or made available by request on cd).
Is this about right? Also, do you still have to include the file size next to the link and if so, should that be done no matter what the size, or only if large?
Thanks.
I'd say that you should take a look at the sites that compute download time based on connection type. I'm sure you've seen them:
foo.pdf [1.5 M-bytes] - 4+ min. (dialup), 20 sec. (cable/DSL), 9 sec. (T1)
arf.pdf [5.4 M-bytes] - 15 min. (dialup), 1+ min. (cable/DSL), 30+ sec. (T1)
I'd use 6 k-bytes/sec. for dialup, 80 k-bytes/sec. for cable/DSL, and 170 k-bytes/sec. for T1 (or real DSL, but nobody sells real DSL). I'd be interested to see what other people think.
I believe the issue is download time rather than file size -- but they are related of course.
On capped (broadband) services file size can be more important - particulary towards the end of the month. Ok, so PDFs shouldn't be too big in this respect, but hey.
include the file size next to the link
Yes, agree.
For large (3+MB I would have said) it may be better to force a download rather than allow it to be opened in the browser - this may help reduce bandwidth if that is an issue? Just a thought?
Interesting -- how does one force a download?
You basically want to tell the browser that the type of this file is 'something else'. If the browser does not recognise the type of the file then it will prompt to download it - as it doesn't know how to 'open' it.
Server-side, you need to set the "Content-Type" and "Content-Disposition" headers (and may be "Content-Length" and others to effect caching etc.) when the file is requested. In PHP you can do something like:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=downloaded_file_name.pdf'); Or, you could set this in an Apache .htaccess file to force all files in a sub directory tree to be downloaded when requested:
ForceType application/octet-stream
Header set Content-Disposition attachment
Depending on how this is implemented, the browser may still try to open the file if the browser ignores the Content-Type header and simply uses the file extension to determine the file type. And FF can be configured to do whatever you like with any file type of your choice. But most modern browsers should handle this OK.
Check out the readfile() page of the PHP manual [uk3.php.net] for more info.