Home > Enterprise >  How do you get the upload URL of a backend server so you can upload data to it?
How do you get the upload URL of a backend server so you can upload data to it?

Time:12-10

I am trying to upload some data to firebase storage by using an upload URL instead of the traditional way by using: Storage.storage().reference().child("Name").putFile("file name")

The reason that I need the URL instead of going the traditional route is because I need to use URLSession to upload data so my task can finish uploading in the background if the user closes out of the app during the upload time.

Summary: How do you get the URL of my firebase storage so I can directly upload data through my URL using URLSession instead of using the traditional route?

Thanks in advance! Let me know if you have any questions.

CodePudding user response:

There is no way to generate a signed upload URL through the Firebase SDKs for Cloud Storage.

If you want to upload using an upload URL, you'll have to generate the upload URL with one of the GCP SDKs or the REST API (all of which are designed to be used in trusted environments only), and share that with your clients (for example through the Firebase Realtime Database or Firestore, or a custom API endpoint you create in Cloud Functions/Cloud Run).

  • Related