Hello Guys,
I am trying to download a file from Google Drive and Dropbox.
- I upload my PNG file to Google Drive OR Dropbox
- click share and create public download link
- Now I have public URL to download the file
I have used below code :
local function networkListener( event ) if ( event.isError ) then print( "Network error - download failed: ", event.response ) elseif ( event.phase == "began" ) then print( "Progress Phase: began" ) elseif ( event.phase == "ended" ) then print( "Displaying response image file" ) myImage = display.newImage( event.response.filename, event.response.baseDirectory, 60, 40 ) myImage.alpha = 0 transition.to( myImage, { alpha=1.0 } ) end end local params = {} params.progress = true network.download( "PUBLIC URL from Google Drive OR Dropbox", "GET", networkListener, params, "helloCopy.png", system.TemporaryDirectory )
– I can see a message in console that “helloCopy.png” is not a valid image file.
–> When I used this url : “http://docs.coronalabs.com/images/simulator/image-mask-base2.png”
it’s working.
– I have tried same code to download a zip file also and then I tried to uncompress zip file manually on my Mac. (Error : unsupported file screenshot)
Please help me regards this , what I can’t download files from google drive and dropbox public link ?
Thank you.
Bhavin