简体   繁体   English

无法使用WebClient下载.sql,.flag,.tmp,.InstallState文件

[英]Cannot download .sql, .flag, .tmp, .InstallState files with WebClient

I'm trying to download some files from a virtual directory using WebClient class and DownloadFile method, all files download good except files with .sql, .flag, .tmp, . 我正在尝试使用WebClient类和DownloadFile方法从虚拟目录下载一些文件,所有文件下载都很好,除了.sql,.flag,.tmp等文件。 InstallState extensions. InstallState扩展。 I get the "HTTP Error 404 - File or directory not found" error. 我收到“ HTTP错误404-找不到文件或目录”错误。 This extensions are not in the Application Configuration Mappings, so what do I have to configure in order to download this files? 此扩展不在应用程序配置映射中,因此我必须配置什么才能下载此文件? Because I can't figure it out. 因为我无法弄清楚。 Thx. 谢谢。 (I'm using windows server 2003 ) (我正在使用Windows Server 2003)

The reason for this is that the web server probably doesn't have MIME types configured for these file extensions. 原因是Web服务器可能没有为这些文件扩展名配置MIME类型。

Because these are being served as static files over HTTP you'll need to add them. 由于这些文件通过HTTP用作静态文件,因此您需要添加它们。

If these files are residing on a public facing server administered by you, do you think it's wise to be serving these? 如果这些文件驻留在您管理的面向公众的服务器上,您认为提供这些文件是明智的吗? Why not obtain via FTP? 为什么不通过FTP获取?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM