Maison  >  Article  >  développement back-end  >  PHP能用curl发送request header然后直接下载文件吗?

PHP能用curl发送request header然后直接下载文件吗?

WBOY
WBOYoriginal
2016-06-06 20:24:321232parcourir

PHP用curl发送cookie、referer等request header之后再location跳转,那么本次会话服务器接收到request header了吗?

如果不能,
那么请问,在服务端没有setcookie的情况下,怎么通过PHP直接下载需要cookie验证的文件到用户端。
我之前的思路是php curl 发送cookie给服务器,然后再header location跳转。可惜不行。

我这么做是为了让flash/html5在服务端没有setcookie的情况下播放需要cookie验证的视频文件

回复内容:

PHP用curl发送cookie、referer等request header之后再location跳转,那么本次会话服务器接收到request header了吗?

如果不能,
那么请问,在服务端没有setcookie的情况下,怎么通过PHP直接下载需要cookie验证的文件到用户端。
我之前的思路是php curl 发送cookie给服务器,然后再header location跳转。可惜不行。

我这么做是为了让flash/html5在服务端没有setcookie的情况下播放需要cookie验证的视频文件

既然服务端没有secookie, 那拿什么来验证cookie? 你这问题描述的有问题。

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn