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.

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

报告相同问题?

悬赏问题

  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解