Hi
I'm trying to upload a js resource file from my local machine using cloud shell.
I'm using the api mentioned below for the same.
I'm referring the api mentioned in this documentation - https://cloud.google.com/apigee/docs/api-platform/develop/resource-files
However I'm getting an error "(26) Failed to open read local data from file/application.
curl -X POST https://apigee(dot)googleapis(dot)com/v1/organizations/myorg/environments/test/resourcefiles?name=fileName.js
-H "Authorization: Bearer $TOKEN" \
-H "Content-type:multipart/form-data" \
-F file=@"/C:/Users/username/Downloads/fileName.js"
I tried providing path in multiple ways, still getting same error. Any help is appreciated. Thanks
This seems like two issues here.
The examples I have seen show it like this:
curl -i -H "Content-Type: application/octet-stream" \
-H "Authorization: Bearer $TOKEN" \
-X POST \
"https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/resourcefiles?type=jsc&name=foobar.js" \
-d "@c:\Users\username\dev\scripts\my-file.js"
Notes:
That assumes no WSL. Have you tried that? I just tried that from my Windows machine and it works. (But I used PowerShell so the line-continuation characters were backticks not backslashes).