Skip to content
Back

Error Adding Apk To Storage Using Curl

  • 1
  • Storage
  • REST API
202420505
25 Feb, 2025, 01:35

I used github actions to build apks and upload them to appwrite storage but It says that fileId is not optional with the below code

TypeScript
curl -X POST "***/storage/buckets/***/files" \
   -H "X-Appwrite-Project: ***" \
   -H "X-Appwrite-Key: ***" \
   -H "Content-Type: application/vnd.android.package-archive" \
   -F "file=@app/build/outputs/apk/release/app-release.apk" \
   -F "fileId=***"
TypeScript
{"message":"Param \"fileId\" is not optional.","code":400,"type":"general_argument_invalid","version":"1.6.1"}

When I upload it in console and download the apk file, It is zipped and when I unzip the file it shows my codes


https://github.com/user-attachments/assets/aeee101c-18dc-44c0-8e23-975b6349977e


https://github.com/202420505/TEST_CURL/blob/main/.github/workflows/upload-apk.yml

TL;DR
Error occurs when trying to add an APK to storage using Curl. Developer is receiving a "fileId is not optional" message. When uploading in console, the downloaded APK is zipped and shows codes upon unzipping. Solution may involve adjusting the Curl command to include the required fileId parameter. Review provided resources for more context.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more