0
ローカルマシンにあるファイルを特定のパスでダウンロードしようとしています。私は、次の設定を使用しようとしましたが、私は、URLAngularJsでローカルパスのファイルをダウンロードする
myApp.config([
'$compileProvider',
function($compileProvider)
{
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|file|blob|ftp|mailto|chrome-extension):/);
}
]);
で同じ危険なを追加しました
<file-download fileurl="{{ Pathfile }}" linktext="Click to download"></file-download>
myApp.directive('fileDownload', function(){
return {
restrict: 'E',
scope: {
fileurl: '@fileurl',
linktext: '@linktext'
},
template: '<a href="{{ fileurl }}" download>{{ linktext }}</a>',
link: function(scope, elem, attrs) {
}
}
});
:
私はダウンロードして、次のコードをしたが、HTML5の方法とNG-HREFをattrubit
私はいつもダウンロードのURLで安全ではありません。どのようにそれを修正できますか?
サーバー提供以外のファイルにはアクセスできません –
ローカルマシンがサーバーであると見なすと別の方法がありますか? – selma