専用のダウンロードツールを用意するとか・・・
PHPだとこんな感じimgdownload.php
PHP
1<?PHP
2$file=filter_input(INPUT_GET,"file");
3if(!file_exists($file)){
4 print "not exists!";
5}elseif(preg_match("/\.(jpg|png|gif)$/",$file)){
6 header("Content-type: application/octet-stream");
7 header("Content-Disposition: attachment; filename=\"$file\"");
8 readfile($file);
9 exit;
10}else{
11 print "not image!";
12}
あとはhtmlでこう
html
1<a href="imgdownload.php">指定なし</a>
2<a href="imgdownload.php?file=1.hoge">存在しない</a>
3<a href="imgdownload.php?file=1.txt">1.txt</a>
4<a href="imgdownload.php?file=1.jpg">1.jpg(カレントのファイル)</a>
5<a href="imgdownload.php?file=images/2.jpg">images/2.jpg(相対パスOK)</a>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/01 07:43 編集
2016/07/01 07:56