Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

118
Views
Expo DownloadAsync don't download files which contains spaces in filename

I have a problem with DownloadAsync when trying to download files from Firebase storage. If filename doesn't contain spaces it works fine and file is downloaded to app, but if it have a space in file name, then that file is ignored and not downloaded. Problem appears only in iOS, with Android I did't have this problem.

Also Firebase gives me a link for that file, so there is no problem with Firebase.

This is how my code looks:

await getDownloadURL(
   ref(
      storage,
      `/images/objects/${touristObject.id}/${file}`
   )
)
.then(async (url) => {
   const fileReference = 
      `${FileSystem.documentDirectory}images/objects/${touristObject.id}`

   await FileSystem.makeDirectoryAsync(
      fileReference,
      { intermediates: true }
   )
                                      
   await FileSystem.downloadAsync(
      url,
      `${fileReference}/${file}`
   )
   .then((uri) => { resolve() })
   .catch((error) => {
      console.warn(error)
      resolve()
   })
})
.catch((error) => {
   console.warn(error)
   resolve()
})
7 months ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.