Msg#: 3599633 posted 4:08 pm on Mar 13, 2008 (gmt 0)
Can anyone advise me on how to handle pdfs on a website? Any general industry guidelines to follow? I handle the administration of about 180 users that post to a content management system, and I need to develop a policy to require them to follow. I found this site that lists some guidelines that sounded pretty realistic.
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?
Msg#: 3599633 posted 9:56 pm on Mar 16, 2008 (gmt 0)
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:
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.