使用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

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.