Unable to download files on rhodes 4.0

J Jochem Pouwels 3 years 5 months ago
2 3 0

I cant seem to get to get downloading files working on the new RhoMobile
I tried the public, app and apps folder, but everytime I get an error that says it cant create the file, so it looks like I dont have permission on any of these folders?

It works in the simulator but not on the real device.
Anyone got an example for me that works??

Ps. (I test on an iPhone 5 with iOs 7)

Please Register or Login to post a reply

3 Replies

A Armen Malxasyan

Is that possible to download the file directly to /Libraries/Cache  folder????

K Kutir Mobility

Hi Jochem,
The userFolder is guaranteed to be writable on all platforms, so can try with it?

Thank you.
Visnupriya R
Kutir Mobility

J Jochem Pouwels

Even if I use the example from the documentation, it wont work (this uses the userFolder)
---
def download_file
   #Download a file to the specified filename.
  downloadfileProps = Hash.new
  downloadfileProps["url"]='http://www.google.com/images/icons/product/chrome-48.png'
  downloadfileProps["filename"] = Rho::Application.publicFolder+"/images/sample.png"
  downloadfileProps["overwriteFile"] = true
   Rho::Network.downloadFile(downloadfileProps, url_for(:action => :download_file_callback))
  end
---

I can try on some other devices soon..

CONTACT
Can’t find what you’re looking for?