Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 旋度:(26)不能';t打开文件"/Users/name/Desktop/thefile.pdf“;_Php_Curl_File Upload_Terminal_Upload - Fatal编程技术网

Php 旋度:(26)不能';t打开文件"/Users/name/Desktop/thefile.pdf“;

Php 旋度:(26)不能';t打开文件"/Users/name/Desktop/thefile.pdf“;,php,curl,file-upload,terminal,upload,Php,Curl,File Upload,Terminal,Upload,我应该使用curl-on-terminal将一个pdf文件上传到一个站点上,下面是我的curl命令 curl -F file=@/Users/name/Desktop/thespecificfile.pdf http://thewebsite/// curl -F "file=@/Users/name/Desktop/thespecificfile.pdf" "http://thewebsite///" 然而,我返回的文本是错误的请求 浏览器(或代理)发送了此服务器无法理解的请求 我该如何补

我应该使用curl-on-terminal将一个pdf文件上传到一个站点上,下面是我的curl命令

curl -F file=@/Users/name/Desktop/thespecificfile.pdf http://thewebsite///
curl -F "file=@/Users/name/Desktop/thespecificfile.pdf" "http://thewebsite///"
然而,我返回的文本是错误的请求 浏览器(或代理)发送了此服务器无法理解的请求

我该如何补救

我加了一个。前/用户/

curl -F file=@./Users/name/Desktop/thespecificfile.pdf http://thewebsite///
这似乎更好,但会弹出此错误消息

curl: (26) couldn't open file "./Users/name/Desktop/thefile.pdf"

无论如何,要解决这个问题?

pdf文件url不需要“.”。别忘了文件周围的引号

应该是: