简体   繁体   English

getimagesize函数不返回任何内容

[英]getimagesize function doesn't return anything

I am using php function getimagesize(). 我正在使用php函数getimagesize()。 It does work in almost all condition but it doesn't work for a particular url. 它确实可以在几乎所有条件下工作,但不适用于特定的网址。 Please help me why isn't it working for that url. 请帮助我,为什么它不适用于该网址。 Below you can check that url: 您可以在下面检查该网址:

getimagesize('https://marketdataresearch.credit-suisse.com/cs/mdr/p/s/framework10/img/logo_cs.gif');

It returns nothing and not giving any error. 它什么也不返回,不给出任何错误。

That specific URL actually has some rudimentary security behind it. 该特定URL实际上具有一些基本的安全性。 If you use curl to fetch that URL you will see the following location header: 如果您使用curl来获取该URL,则会看到以下位置标头:

Location: /cookie-check?trg=insanely-long-strong

When you follow that, you just end up on a regular HTML page. 当您遵循该步骤时,您仅会进入常规的HTML页面。 What you're trying to do won't be possible without fetching the cookie, using the cookiejar in a curl request, downloading the file, and running getimagesize against the local file. 如果不获取cookie,在curl请求中使用cookiejar,下载文件并针对本地文件运行getimagesize ,则您要尝试执行的操作将无法实现。

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

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