訪問IIS伺服器的json檔案報錯:404
轉載自:win7如何本地讓IIS伺服器可以讀取json檔案
首先,就需要配置本機IIS服務,在win7下找到“開啟或關閉windows功能”,選擇“Internet資訊服務”,然後確定,等待系統更新,成功後,就可以直接在瀏覽器輸入“localhost”顯示出IIS7訊息。然後在執行中輸入iis,開啟IIS管理器,在網站下有一個Default web site,右鍵選擇“瀏覽”,就可以看到本地伺服器的根目錄,把需要訪問的html等資原始檔放在這裡就可以直接用“localhost/xxx.html”的形式從瀏覽器訪問他們了。問題此時又出現了,當我把.json和.html放進來以後,發現仍然是空白頁,於是再一次查閱資料,知道了IIS7預設不能解析.json檔案,所以需要配置,方法如下:
1、在IIS管理器左邊選擇你要設定的網站
2、進入後選擇新增,會彈出新增MIME型別對話方塊,在副檔名中輸入”.json”,在MIME型別中輸入”text/json”(不要雙引號).點選確認,再重啟網站即可
3、若以上步驟還不能讀到JSON資料,則在IIS需要再新增“處理程式對映”
然後重新啟動IIS7服務即可。
就這樣,幾番周折,終於顯示出了想要的結果。
相關推薦
訪問IIS伺服器的json檔案報錯:404
轉載自:win7如何本地讓IIS伺服器可以讀取json檔案 首先,就需要配置本機IIS服務,在win7下找到“開啟或關閉windows功能”,選擇“Internet資訊服務”,然後確定,等待系統更新,成功後,就可以直接在瀏覽器輸入“localhost”顯示出
chrome非同步載入本地json檔案報錯:cross origin request are only supported for HTTP
定義了一個data.json檔案儲存學生相關資訊,在index.html中想通過$.getJSON("data.json" , function(data){...})方法獲取並顯示json檔案中的內容。 結果執行後chrome報錯如下:Cross origin reque
python 向linux vsftpd伺服器傳檔案報錯:ftplib.error_perm: 550 Permission denied
使用ftp模組向vsftpd伺服器上傳檔案報550錯誤的,程式碼如ftprun.py所示,vsftpd伺服器執行在ubuntu16.04。 解決方法解: 修改配置檔案:sudo gedit /etc/vsftpd.conf 去掉“write_enable=YES”前面
瀏覽器訪問IIS伺服器上面的plist檔案報錯:HTTP Error 404.3
報錯:HTTP Error 404.3 - Not FoundThe page you are requesting cannot be served because of the extension configuration. If the page is a scrip
IIS配置問題:WCF服務開啟svc檔案報錯:請求的內容似乎是指令碼,因而將無法由靜態檔案處理程式來處理
在參考網上多個教程後,我用IIS配置的網站終於能正常打開了,但是很快就發現了新的問題,在開啟WCF服務中的svc檔案時報錯:HTTP 錯誤 404.17 - Not Found請求的內容似乎是指令碼,因而將無法由靜態檔案處理程式來處理。沒辦法,又在網上找各種解決辦法,然後再下
sshclient上傳檔案報錯:encountered 1 errors during the transfer解決方法
encountered 1 errors during the transfer解決方案: 1.檢視要檔案目錄許可權,當前使用者對要上傳檔案的目錄 要有rwx許可權; 2.把伺服器上同名檔案先備份在上傳; 3.如果檔案在桌面上上傳不了,將要上傳的檔案複製到其它分割槽,再上
mac終端下執行java檔案報錯:找不到或無法載入主類
由面試題出來的 為了顯示 myStr = 23 這樣的結果,寫出在控制檯輸入的命令 public class MyClass { public static void main(String args[]) { String s1 = args[0]; String s2 = args[
連線私服倉庫maven的pom檔案報錯:Project build error: Non-resolvable parent POM
配置了私服maven倉庫,在內網160伺服器上,修改了maven配置檔案。下載了一個專案,pom檔案報錯 問題如圖: 將<version>1.5.13.RELEASE</version>改成<version
解決Go上傳檔案報錯:找不到Boundary的問題
最近要做一個元件,即接收客戶端的請求,經過一系列的封裝,將請求傳送給真正的服務端器。可以理解為:客戶端使用Http的Request的Body儲存檔案流,將Request傳送給伺服器。遇到一個問題:傳入的是一個檔案控制代碼File,需要轉換成byte[]存到request的body中,但是發現boun
關於springboot上傳檔案報錯:The temporary upload location ***is not valid
在執行springboot時 ,長時間執行後報錯 the temporary uplaod location *** is not valid 查過資料後發現是centos對‘/temp’下檔案自動清理的原因。 在springboot專案啟動後 系統會在‘/temp’目
【轉載】讀取txt檔案報錯:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0
python在open讀取txt檔案時,出現UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xc8 in position 0: invalid continuation byte報錯 解決辦法有二: ①把編碼方式utf-8
伺服器使用phantomjs報錯:phantomjs unexpectedly exited. Status code was: 127
原因是因為缺少phantomjs執行的依賴包 Ubuntu嘗試: sudo apt-get install libfontconfig centos嘗試: 用wget安裝phantomjs依賴的libfontconfig sudo yum install fontconfi
javaweb中的xml檔案報錯:Multiple annotations found at this line:
今天在學習java web中的Filter的時候在配置xml檔案的報了一個錯誤: Multiple annotations found at this line: - <?xml version="1.0" encoding="UTF-8"?>
匯入json檔案報錯,TypeError: expected string or buffer
主要內容是: 用字串符值以後,python會把雙引號轉換為單引號 >>> s={"username":"admin","password":"password","tenantid":""} >>> print s {'user
spring pom檔案報錯:提示no declaration can be found for element 'dubbo:service'.
pom檔案報錯:The matching wildcard is strict, but no declaration can be found for element 'dubbo:service'. 解決辦法: 找到dubbo的jar包,解壓後在META-INF
Python3 pandas read_csv 讀取txt檔案報錯:IOError: Initializing from file failed
錯誤程式碼: data=pd.read_csv(‘C:\Users\lenovo\Desktop\停用詞檔案\字尾詞處理260\handle_data_01.txt’,sep=’\n’) print
Android Studio新增AAR檔案報錯:the versions of the android gradle plugin and gradle are not compatible,plea
在專案新增AAR檔案報錯:Error:Execution failed for task ':app:prepareAlivcPlayerLibrary'. > Could not expand ZIP '/xxxx/app/libs/AlivcPlayer.a
匯入sql檔案報錯:1071 Specified key was too long; max key length is 767 bytes
2018年05月22日 15:53:58 李長念 閱讀數:1503 一、背景 今天把伺服器的資料庫匯出了一份sql檔案,
centos上解壓檔案報錯:tar: Error is not recoverable: exiting now
例如解壓檔案命令為: tar -zxvf hadoop-2.6.2.tar.gz 解壓時錯誤資訊為: gzip: stdin: unexpected end of file tar: Unexpec
Eclipse json檔案報錯(出現小紅叉)!
工程裡面得所有以.json結尾得檔案報錯(出現小紅叉)!,雖然對工程啟動沒有影響,但是看著實在不舒服;解決辦法:Window > Preferences > Eclipse > 搜尋Validation > 右側將“JSON Validator”得勾關