duanluwei9374 2011-03-24 13:13
浏览 80
已采纳

使用Rest Architecture在PHP中使用PUT请求发送文件名

How can I send the filename to an apache server if I'm using curl with

 curl_setopt($ch, CURLOPT_PUT, 1);

One solution was to send the filename using the URL. - there are several problem with this - the biggest problem is the url can be invalid containing white spaces for example so I can't validate in anyway the filename

  • 写回答

1条回答 默认 最新

  • dongqing7789 2011-03-24 13:22
    关注

    Link

    CURLOPT_PUT (boolean) If true, sets the cURL session to perform an HTTP PUT operation. Information about the file to be sent is set with CURLOPT_INFILE and CURLOPT_INFILESIZE.

    And if you mean the resulting filename on the server, that would be

    CURLOPT_URL (string) Sets the URL of the remote resource to which to connect. Overrides any value given directly to curl_init() .

    You have to configure apache to handle PUT Requests.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容