Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by carboneUser · Jan 27, 2017 at 06:38 PM · imageurlescape

URL Escaping for Firebase

I am trying to download a image stored in the Firebase Storage, using Unity. I use Unity Firebase SKD (in Beta...). This is my code:

  ...
  // Points to "1/preview.jpg"
     Firebase.Storage.StorageReference img_ref = folder1_ref.Child("/preview.jpg");

 // Fetch the download URL
 img_ref.GetDownloadUrlAsync().ContinueWith(task => {
     Debug.Log(task.Result.ToString());
     });

The console output is:

 https://firebasestorage.googleapis.com/v0/b/insidehome-29c9e.appspot.com/o/1/preview.jpg?alt=media&token=092a8de8-5047-4bce-b179-edd4101847a3

If I try to download the file using www or a browser, with this URL, I obtain an error. The good URL should be (copied by Firebase console):

 https://firebasestorage.googleapis.com/v0/b/insidehome-29c9e.appspot.com/o/1%2fpreview.jpg?alt=media&token=092a8de8-5047-4bce-b179-edd4101847a3

The difference is only in a single slash ("/") before the word "preview", transformed in %2f

Is this strange? How could I fix it? I try Escape the URL but it change all the slash:

 https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Finsidehome-29c9e.appspot.com%2Fo%2F1%2F99%2Fobama.jpg%3Falt%3Dmedia%26token%3D8a33f998-e271-4d7e-8848-356a332b7750

And It does't work. I need to change only the parameters (right) slash

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image amr_mahmoud_unity · May 20, 2017 at 01:39 PM 0
Share

Did you find a solution for this issue?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by amr_mahmoud_unity · May 20, 2017 at 02:23 PM

Did you find a solution for this issue?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by anjuman · Jun 19, 2017 at 05:20 AM

task.Result.OriginalString will work.

 reference.GetDownloadUrlAsync ().ContinueWith ((task) =>
  {
     if (task.IsFaulted || task.IsCanceled) {
         Debug.Log(task.Exception.ToString());
                 // Uh-oh, an error occurred!
         } else {
              uri = task.Result.OriginalString;
                 
         }
 });

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get a random image url from google image search 0 Answers

Does anyone have a solution for async image loading from url? 1 Answer

Map an Image onto an object from a URL 0 Answers

how do i put an image from the internet in unity? 2 Answers

How can I fill a list with images from an external source? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges