Safariでもファイルを強制ダウンロードしたい - [https://teratail.com/questions/62974][https://teratail.com/questions/62974]
同じ質問をさせていただきましたが、HTML5のdownloadは、Safariなどでは使えません。
Githubのraw機能を使おうと考えましたがうまく動作しません。
なので、次のSafariが対応するという噂を聞きましたが、やはり対応したいなと考えました。
lightgallery.jsを使用したギャラリー - https://teratail.com/questions/67484
しかし、ギャラリーなためphpを使ったダウンロードを行うのには手間がかかりすぎる(200枚ほどの画像)ので、他の方法を探しています。
PHP
1<?php 2//パス 3$fpath = './a.jpg'; 4//ファイル名 5$fname = '画像名.jpg'; 6 7header('Content-Type: application/force-download'); 8header('Content-Length: '.filesize($fpath)); 9header('Content-disposition: attachment; filename="'.$fname.'"'); 10readfile($fpath);
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/19 13:18
2017/03/21 03:42