Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am getting this error, when I am trying to call a box api through curl.

curl: (26) couldn't open file

Can't find why! I am calling this api with a correct file name-

curl https://upload.view-api.box.com/1/documents 
-H "Authorization: Token YOUR_API_TOKEN" 
-H "Content-type: multipart/form-data" 
-F file=@A_correct_file_name

I have seen all the three already asked questions but 2 of them are unanswered and one is specific to facebook.

cURL error 26 couldn't open file

Fatal error: Uncaught CurlException: 26: couldn't open file "" thrown in

Getting Fatal Error Uncaught CurlException: 26: couldn't open file

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

I was having a similar problem after changing to PHP 5 (I was using the @ upload method and it was deprecated, so I had to start using CURLFile), and the solution to my problem was found in this stack.

Solution: curl upload won't work with relative paths, use the full path instead


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...