PHP如何验证文件? [英] PHP how to verify the file?

查看:110
本文介绍了PHP如何验证文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站托管中托管了一个名为'test.html'的文件。

例如网址是:www.example.com/test.html。

现在如何在我的网络托管中检查test.html是否可用。

I have hosted a file in my web hosting called 'test.html'.
For example the url is: www.example.com/test.html.
Now how to check if test.html is available or not in my web hosting.

推荐答案

如果你想检查文件是否托管,你可以测试域名为/ yourfilename.extension的文件。但如果您想以编程方式进行,那么我认为您需要检查从您的应用程序连接的托管服务器。我不知道你想如何检查托管服务器中的文件。



如果我的假设是正确的,你想通过你的应用程序检查服务器中的文件,然后尝试这个链接dude

http://stackoverflow.com/questions/4852767/how-can-i-check-if-a-file-exists-on-a-remote-server-using-php [ ^ ]


http://stackoverflow.com/questions/17654167/php-script-to-check-on-remote-server-a-file-exists [ ^ ]

其中一个链接swers可以帮助你,只是尝试一下,让我们知道这是否有效



谢谢

Ganesh
If you want to check whether the file is hosted or not you can test the file with the domain name/yourfilename.extension. but if you want to do programatically then I think u need to check in your hosting server connected from your application. I dont know how you want to check your file in the hosting server.

If my assumption is right you want to check for a file in the server thru your application, then try this link dude
http://stackoverflow.com/questions/4852767/how-can-i-check-if-a-file-exists-on-a-remote-server-using-php[^]
or
http://stackoverflow.com/questions/17654167/php-script-to-check-on-remote-server-a-file-exists[^]
one of the links answers might helps you, just give a try and let us know if this does not works

Thanks
Ganesh


这篇关于PHP如何验证文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆