19

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.

Alohomora
  • 417
  • 1
  • 5
  • 12

5 Answers5

7

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.

sja
  • 2,064
  • 2
  • 18
  • 22
7

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.

Deb_IT
  • 71
  • 1
  • 2
  • this worked for me. though a colleague of mine was able to run our command (which was very similar to the example here) with quotes, so I wonder if the coniguration of each individual machine matters here? – kdub1312 Aug 22 '22 at 11:30
2

In addition to making sure the quotes were in the correct place, I had to remove the tilde that I first included in my file path.

Bad:

curl -F dsym=@"~/Users/<user-name>/Downloads/<file_name>.dSYM.zip" -H "X-APP-LICENSE-KEY: theKey" https://theplaceto.upload

Good:

curl -F dsym=@"/Users/<user-name>/Downloads/<file_name>.dSYM.zip" -H "X-APP-LICENSE-KEY: theKey" https://theplaceto.upload```**
Xeaza
  • 1,410
  • 1
  • 17
  • 21
1

I resolved this problem by replacing single quotes with double quotes instead.

I changed this:

curl -F 'file=@addresses.json' https://location-bq-datasets.cloudfunctions.net/sample-endpoint

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

To this:

curl -F "file=@addresses.json" https://location-bq-datasets.cloudfunctions.net/sample-endpoint

You also don't need to place your endpoint https://api.us-west-1.saucelabs.com/v1/storage/upload in quotes.

Banty
  • 532
  • 6
  • 10
0

Use below command for me it resolved

curl -F "file=@C:/Users/LENOVO/Desktop/git/ppt/8.apk" http://localhost:8000/api/v1/upload -H "Authorization:f06ecb3505899296f03b0c21d7dc5baf83fb999e3d0b4c1243874c82c0184874"
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103