Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Trouble with network.Download
Started by artsystem.gerardo Nov 26 2018 11:47 AM

No replies to this topic
download network file pdf
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

artsystem.gerardo

[GLOBAL: userInfoPane.html]
artsystem.gerardo
  • Observer

  • 2 posts
  • Corona SDK

Hi everyone

 

I recently started developing with corona

 

My first app is a free access book download

 

However, i'm having trouble with the download

 

I have an event function, called from multiple components (images of the books), each component has a custom property for it's file link and name, for example:

event.target.enlace="http://irizamar.com/libros/don_quijote_1.pdf"
event.target.file="don_quijote_1.pdf"

This is the function

local function descargarLibro( event )
	if ("ended" == event.phase) then

		print( event.target.enlace )
		print( event.target.archivo )
		network.download( event.target.enlace, "GET", downloadListener, event.target.archivo, system.DocumentsDirectory)
	end
end

If i use print() i can see those values on the console, but the file is not downloading anywhere, not on corona's emulator, nor on my phone

 

You can use that same link to access the book right now, so it's not a problem on the server side

 

And if I use display.loadRemoteImage, the image does get downloaded from the same server

 

Thanks in advance




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: download, network, file, pdf