2017-11-13 10 views
0

내 cordova 앱에서 pdf 파일을 다운로드하려고하는데 http (https가 작동하지 않음)를 통해 다운로드 할 수있는 파일 만 가져올 수 있습니다. 나는 비주얼 스튜디오를위한 코르도바 도구를 사용하고하는 것은 2017 년Cordova를 SSL을 통해 PDF로 다운로드하는 방법은 무엇입니까? 비 SSL 다운로드 작동 OK

이 작동 :

<p><a href="http://q75.mydevelopmentserver.com/downloads/test.pdf">Download test PDF</a></p> 
<p><a href="http://q75.mydevelopmentserver.com/downloads/test.pdf" target="_blank">Download test PDF (new window)</a></p> 

이 작동하지 않습니다 - 내가 링크를 클릭 할 때 아무 일도 발생하지 않습니다 :

<p><a href="https://q75.mydevelopmentserver.com/downloads/test.pdf">Download test PDF</a></p> 
<p><a href="https://q75.mydevelopmentserver.com/downloads/test.pdf" target="_blank">Download test1 PDF (new window)</a></p> 

누구나 생각하는 이유가 https 링크가 작동하지 않습니까? 나는 암호화 SSL을 사용하고있다 & 그것은 나에게 좋아 보인다.

이 내 코르도바 메타 태그입니다 :

<?xml version="1.0" encoding="utf-8"?> 
<widget xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" id="com.fencingquotesystem.mobile" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" defaultlocale="en-AU"> 
    <name>FQS</name> 
    <description>FQS</description> 
    <author href="http://cordova.io" email="[email protected]">MWD</author> 
    <vs:template-name>BlankJS</vs:template-name> 
    <vs:toolsetVersion>6.3.1</vs:toolsetVersion> 
    <engine name="android" spec="~5.2.1" /> 
    <engine name="ios" spec="~4.2.0" /> 
    <engine name="windows" spec="~4.4.2" /> 
    <content src="index.html" /> 
    <preference name="SplashScreen" value="screen" /> 
    <preference name="windows-target-version" value="10.0" /> 
    <!-- Support for Cordova 5.0.0 plugin system --> 
    <plugin name="cordova-plugin-whitelist" spec="1.2.2" /> 
    <allow-intent href="http://*/*" /> 
    <allow-intent href="https://*/*" /> 
    <allow-intent href="tel:*" /> 
    <allow-intent href="sms:*" /> 
    <allow-intent href="mailto:*" /> 
    <allow-intent href="geo:*" /> 
    <allow-navigation href="https://q75.mydevelopmentserver.com/*" /> 
    <platform name="android"> 
    <allow-intent href="market:*" /> 
    </platform> 
    <platform name="ios"> 
    <allow-intent href="itms:*" /> 
    <allow-intent href="itms-apps:*" /> 
    </platform> 
    <platform name="android"> 
    <icon src="res/icons/android/icon-36-ldpi.png" density="ldpi" /> 
    <icon src="res/icons/android/icon-48-mdpi.png" density="mdpi" /> 
    <icon src="res/icons/android/icon-72-hdpi.png" density="hdpi" /> 
    <icon src="res/icons/android/icon-96-xhdpi.png" density="xhdpi" /> 
    </platform> 
    <platform name="ios"> 
    <!-- iOS 8.0+ --> 
    <!-- iPhone 6 Plus --> 
    <icon src="res/icons/ios/icon-60-3x.png" width="180" height="180" /> 
    <!-- iOS 7.0+ --> 
    <!-- iPhone/iPod Touch --> 
    <icon src="res/icons/ios/icon-60.png" width="60" height="60" /> 
    <icon src="res/icons/ios/icon-60-2x.png" width="120" height="120" /> 
    <!-- iPad --> 
    <icon src="res/icons/ios/icon-76.png" width="76" height="76" /> 
    <icon src="res/icons/ios/icon-76-2x.png" width="152" height="152" /> 
    <!-- iOS 6.1 --> 
    <!-- Spotlight Icon --> 
    <icon src="res/icons/ios/icon-40.png" width="40" height="40" /> 
    <icon src="res/icons/ios/icon-40-2x.png" width="80" height="80" /> 
    <!-- iPhone/iPod Touch --> 
    <icon src="res/icons/ios/icon-57.png" width="57" height="57" /> 
    <icon src="res/icons/ios/icon-57-2x.png" width="114" height="114" /> 
    <!-- iPad --> 
    <icon src="res/icons/ios/icon-72.png" width="72" height="72" /> 
    <icon src="res/icons/ios/icon-72-2x.png" width="144" height="144" /> 
    <!-- iPhone Spotlight and Settings Icon --> 
    <icon src="res/icons/ios/icon-small.png" width="29" height="29" /> 
    <icon src="res/icons/ios/icon-small-2x.png" width="58" height="58" /> 
    <!-- iPad Spotlight and Settings Icon --> 
    <icon src="res/icons/ios/icon-50.png" width="50" height="50" /> 
    <icon src="res/icons/ios/icon-50-2x.png" width="100" height="100" /> 
    </platform> 
    <platform name="windows"> 
    <icon src="res/icons/windows/Square150x150Logo.scale-100.png" width="150" height="150" /> 
    <icon src="res/icons/windows/Square150x150Logo.scale-240.png" width="360" height="360" /> 
    <icon src="res/icons/windows/Square30x30Logo.scale-100.png" width="30" height="30" /> 
    <icon src="res/icons/windows/Square310x310Logo.scale-100.png" width="310" height="310" /> 
    <icon src="res/icons/windows/Square44x44Logo.scale-100.png" width="44" height="44" /> 
    <icon src="res/icons/windows/Square44x44Logo.scale-240.png" width="106" height="106" /> 
    <icon src="res/icons/windows/Square70x70Logo.scale-100.png" width="70" height="70" /> 
    <icon src="res/icons/windows/Square71x71Logo.scale-100.png" width="71" height="71" /> 
    <icon src="res/icons/windows/Square71x71Logo.scale-240.png" width="170" height="170" /> 
    <icon src="res/icons/windows/StoreLogo.scale-100.png" width="50" height="50" /> 
    <icon src="res/icons/windows/StoreLogo.scale-240.png" width="120" height="120" /> 
    <icon src="res/icons/windows/Wide310x150Logo.scale-100.png" width="310" height="150" /> 
    <icon src="res/icons/windows/Wide310x150Logo.scale-240.png" width="744" height="360" /> 
    </platform> 
    <platform name="android"> 
    <splash src="res/screens/android/screen-hdpi-landscape.png" density="land-hdpi" /> 
    <splash src="res/screens/android/screen-ldpi-landscape.png" density="land-ldpi" /> 
    <splash src="res/screens/android/screen-mdpi-landscape.png" density="land-mdpi" /> 
    <splash src="res/screens/android/screen-xhdpi-landscape.png" density="land-xhdpi" /> 
    <splash src="res/screens/android/screen-hdpi-portrait.png" density="port-hdpi" /> 
    <splash src="res/screens/android/screen-ldpi-portrait.png" density="port-ldpi" /> 
    <splash src="res/screens/android/screen-mdpi-portrait.png" density="port-mdpi" /> 
    <splash src="res/screens/android/screen-xhdpi-portrait.png" density="port-xhdpi" /> 
    </platform> 
    <platform name="ios"> 
    <splash src="res/screens/ios/screen-iphone-portrait.png" width="320" height="480" /> 
    <splash src="res/screens/ios/screen-iphone-portrait-2x.png" width="640" height="960" /> 
    <splash src="res/screens/ios/screen-ipad-portrait.png" width="768" height="1024" /> 
    <splash src="res/screens/ios/screen-ipad-portrait-2x.png" width="1536" height="2048" /> 
    <splash src="res/screens/ios/screen-ipad-landscape.png" width="1024" height="768" /> 
    <splash src="res/screens/ios/screen-ipad-landscape-2x.png" width="2048" height="1536" /> 
    <splash src="res/screens/ios/screen-iphone-568h-2x.png" width="640" height="1136" /> 
    <splash src="res/screens/ios/screen-iphone-portrait-667h.png" width="750" height="1334" /> 
    <splash src="res/screens/ios/screen-iphone-portrait-736h.png" width="1242" height="2208" /> 
    <splash src="res/screens/ios/screen-iphone-landscape-736h.png" width="2208" height="1242" /> 
    </platform> 
    <platform name="windows"> 
    <splash src="res/screens/windows/SplashScreen.scale-100.png" width="620" height="300" /> 
    <splash src="res/screens/windows/SplashScreen.scale-240.png" width="1152" height="1920" /> 
    <splash src="res/screens/windows/SplashScreenPhone.scale-240.png" width="1152" height="1920" /> 
    </platform> 
    <plugin name="cordova-plugin-camera" spec="~2.4.1" /> 
    <preference name="ShowTitle" value="True" /> 
    <preference name="Fullscreen" value="False" /> 
    <preference name="InAppBrowserStorageEnabled" value="True" /> 
    <plugin name="cordova-plugin-device" spec="~1.1.7" /> 
    <access origin="https://q75.mydevelopmentserver.com/" /> 
</widget> 

편집이 :

아래의 SSL 연결은 아무런 문제가 작동하지 않습니다이 내 코르도바 config.xml 파일이

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://q75.mydevelopmentserver.com/ https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *"> 

입니다 :

<p><a href="https://www.adobe.com/content/dam/acom/en/accessibility/products/acrobat/pdfs/acrobat-x-accessible-pdf-from-word.pdf" target="_blank">https - Download test2 PDF (new window)</a></p> 

아마도 Cordova 또는 Android (v7.0)에서 Let 's Encrypt SSL을 좋아하지 않을 수 있습니다.

답변

0

SSL 항목이 여기에 있는지 여부를 모릅니다.

그러나 이러한 종류의 질문은 항상 InAppBrowser를 설치하는 대답을 얻습니다. cordova-plugin-inappbrowser. config.xml에서 해당 플러그인을 볼 수 없습니다. github 링크에서 설명한대로 InAppBrowser는 window.open() 함수를 대신 사용합니다.

또한 PDF가 설치된 pdf 판독기에서 열리려면 target = "_ system"을 사용하십시오.

/big