WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Title attributes on images and links

for

From: Karl Groves
Date: Aug 5, 2009 12:25PM


> From: <EMAIL REMOVED> [mailto:webaim-forum-
> <EMAIL REMOVED> ] On Behalf Of Dean Hamack
> Sent: Wednesday, August 05, 2009 2:12 PM
> To: WebAIM Discussion List
> Subject: Re: [WebAIM] Title attributes on images and links
>
> On 8/5/09 10:33 AM, "Karl Groves" < <EMAIL REMOVED> > wrote:
>
> > This isn't' an 'either-or' thing. I agree with you on the PDF thing.
> > In such a case, you could forcibly set the 'Content-Disposition'
> header to
> > be 'attachment', which will prompt the user with what to do with the
> file
> > (i.e. whether or not to open it in Adobe Reader. Again, I have no
> info
> > on what users' reactions would be to this approach, but may meet your
> > needs.
>
> How do you do this in practice? I'd never heard of this until now.
>

I usually do it with PHP, which you may or may not also use, so I don't
want to bore you with PHP babble if you're an ASP guy.

One quick & dirty way to do it would be with .htaccess

<Files *.pdf>
ForceType application/pdf
Header set Content-Disposition attachment
</Files>


This apparently can be made better with the following:

<FilesMatch ".(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

I haven't used this approach, so YMMV.



Karl