curl: (26) Failed to open/read local data from file/application

Viewed 21752

I'm trying to upload a ipa file to saucelabs storage but getting the error as mentioned above.

The command that I'm using -

$ curl -F 'payload=@/Users/<user-name>/Downloads/<file_name>.ipa' -F name=<file_name>.apk -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY"  'https://api.us-west-1.saucelabs.com/v1/storage/upload'

I'm on mac. I've seen the questions on stackoverflow but none of them answers.

2 Answers

There might be a problem escaping your path. For me your command works, if the file is correct (I get an unauthorized of course). (curl 7.64.1)

Try your command from the Downloads folder:

cd /Users/<user-name>/Downloads
curl -F @<file_name>.ipa -F name=<file_name>.apk -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY"  'https://api.us-west-1.saucelabs.com/v1/storage/upload'

You may have to escape characters in your filename. Tip: You can also try drag and drop the file form finder to Terminal while the cursor is at the point where the filename is. Terminal will escape those automatically.

I was able to resolve this by not using single or double quotes around the file name. curl -u "<userName>:<accessKey>" \ -X POST "https://api-cloud.browserstack.com/app-automate/xcuitest/v2/test-suite" \ -F file=@/path/to/app/file/Application-debug-test.zip. I hope it helps.

Related