简体   繁体   English

如何通过https获取隐藏文件的内容?

[英]How to get a content of a hidden file over https?

Now I am successfully using WebClient.DownloadString to get file content from ESX server. 现在,我已成功使用WebClient.DownloadString从ESX服务器获取文件内容。 My URI is something like: 我的URI类似于:
https://<ip>/folder/<file-path>?dcPath=ha-datacenter&dsName=<datastore-name>

But how can I get a content of a hidden file (eg '.myfile')? 但是,如何获取隐藏文件的内容(例如“ .myfile”)?

UPDATE : I have the 404 or Not Found error message when I receive a response from the server. 更新 :当我收到来自服务器的响应时,我收到404或未找到错误消息。 And nothing happens when I open this url in my browser. 当我在浏览器中打开该URL时,什么也没有发生。 May be there is exist a parameter like 'dcPath' (datacenter path) or 'dsName' (datastore name) for ESX https request to receive a content of a hidden file. 可能存在用于ESX https请求的参数“ dcPath”(数据中心路径)或“ dsName”(数据存储名称),以接收隐藏文件的内容。 Or may be there are ESX server's settings that enable receiving hidden files through the https? 还是可能有ESX Server的设置可以通过https接收隐藏文件?

You would have to configure the webserver to display hidden files. 您将必须配置Web服务器以显示隐藏文件。 There are a lot of file types not shown by default. 默认情况下,有许多文件类型未显示。 Like temporarily editor files, userfiles that happens to be in the wrong directory etc. Most webservers only displays files ending in .html .htm .css etc. This is also the same filer that decides if files should be executed before show, like .jsp .cgi. 像临时编辑器文件一样,用户文件恰好位于错误的目录等中。大多数Web服务器仅显示以.html .htm .css等结尾的文件。这也是决定是否在显示之前执行文件的文件管理器,例如.jsp cgi的。

To read more about how this works on Apache (most common webserver) visit this page 要了解有关在Apache(最常用的Web服务器)上如何工作的更多信息,请访问此页面

Like @UnixShadow suggested you would need to set a mime-type for the file type/extension you are trying to access. 就像@UnixShadow建议的那样,您需要为尝试访问的文件类型/扩展名设置一个mime类型。 But the real issue here is that static files that have the hidden attribute set will return a HTTP 404 or an Access Denied error when browsed. 但是真正的问题是,设置了隐藏属性的静态文件在浏览时将返回HTTP 404或“访问被拒绝”错误。

Configuring access control for all Web files should always be implemented through NTFS permissions. 为所有Web文件配置访问控制应始终通过NTFS权限来实现。

http://support.microsoft.com/kb/216803 http://support.microsoft.com/kb/216803

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

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