2012-01-18 9 views
0

I have a folder named Test. I have some .xls files and .txt , .doc files in it.詳細については、私の<a href="test.xls"> is working and .txt is not?

In the html I have

<p> <a href="../../Test/Stats.xls">Download excel file </a> </p> 
- when I click on this link it is opening a download window (Working fine) 

<p> <a href="../../Test/Stats.txt">Download Text file </a> </p> 

<p> <a href="../../Test/Stats.doc">Download excel file </a> </p> 

But these 2 are not working. Instead of opening a download window they are going to that .doc file link and saying that the page cannot be found.

why the download window is coming for .xls and not for .do or .doc? How can I fix this??

+0

ページが見つかりませんか?ファイル名Stats.docとStats.txtは実際にフォルダ内に存在しますか? –

+0

サーバーのMIMEタイプを調整する必要がある場合があります。 –

+1

テキストファイル(.txt)のブラウザのデフォルトの動作は、Webページであり、ダウンロードするように指示されていないかのようにページを開くことです。それはなぜ404エラーを起こすのか説明しません。 IIS 7を使用している場合、許可された拡張子として.DOC/.DOCXと.TXTのMIMEタイプを持たない可能性があります。 IIS_USERアカウントへのアクセスを妨げる権限の問題がある可能性があります。 Fiddlerのようなユーティリティを使用してIISへのリクエストを監視し、HTTPステータスコードを確認しましたか?あなたはあなたのIISログをチェックしましたか? –

答えて

1

You need to configure your server's MIME types, otherwise either the file will not be served up (and you'll get a 404) or the browser will not know how to handle the type of file.

See this articleはなぜですか。

+0

の警告が表示されています.docのMIMEタイプを追加したのにまだ動作していませんでした:( – SmilingLily

+0

あなたが指しているパスが存在し、 ?イベントID 1309の詳細を確認してください... "指定されたパスが見つかりません"などのメッセージが表示されます。 – RoccoC5

1

Sounds silly, but I'm guessing that you need to check the file names and references to them and make sure they are exactly the same. Unless you are on a Windows box, case sensitivity is something to take into account too.

関連する問題