0

I have an images uploaded on my FTP and because they are really big (sometimes bigger than 10MB), their display takes lot of times, sometimes are not displayed at all.

That's why I would like to denied displaying these files and allow to user only download them - how to do that?

user984621
  • 46,344
  • 73
  • 224
  • 412
  • What is the bandwidth difference between display and download? – Tim M. May 09 '12 at 09:20
  • What to you mean "display" ? Use a browser by http to fetch and display them ? And "download" ? Is that only by ftp ? Do you want to authorize ftp and forbid http access to those files ? – Denys Séguret May 09 '12 at 09:21
  • 1
    Sorry, that's not possible with HTML. – kapa May 09 '12 at 09:22
  • for instance, when I have on page PDF file and link to it, so after click on this link will be the content of this PDF file displayed in the browser. But, I would need instead this display download dialog after click on the link to PDF file. – user984621 May 09 '12 at 09:24
  • The medium is different (text vs video), but as long as you're serving the data from a webserver, this still applies: [Is it possible to protect from downloading a video from a site](http://stackoverflow.com/questions/1790190/is-it-possible-to-protect-from-downloading-a-video-from-a-site) – Piskvor left the building May 09 '12 at 09:32
  • OTOH, you may be *actually* wishing for something slightly different: if you just want that the images etc. are downloaded **by default**, see this: http://stackoverflow.com/questions/5648967/force-download-image – Piskvor left the building May 09 '12 at 09:35

1 Answers1

1

Here is what I have been looking for.

Into the .htaccess

<Files *.pdf>
  Header set Content-Disposition attachment
</Files>
Community
  • 1
  • 1
user984621
  • 46,344
  • 73
  • 224
  • 412