Hi my friend
can someone explain to me how to find the same result with local html files in webView
local function networkListener( event )
if ( event.isError ) then
print( "Network error: ", event.response )
elseif ( event.phase == "began" ) then
if ( event.bytesEstimated <= 0 ) then
print( "Download starting, size unknown" )
else
print( "Download starting, estimated size: " .. event.bytesEstimated )
end
elseif ( event.phase == "progress" ) then
if ( event.bytesEstimated <= 0 ) then
print( "Download progress: " .. event.bytesTransferred )
else
print( "Download progress: " .. event.bytesTransferred .. " of estimated: " .. event.bytesEstimated )
end
elseif ( event.phase == "ended" ) then
print( "Download complete, total bytes transferred: " .. event.bytesTransferred )
end
end
local params = {}
-- Tell network.request() that we want the "began" and "progress" events:
params.progress = "download"
-- Tell network.request() that we want the output to go to a file:
params.response = {
filename = "video2.mp4",
baseDirectory = system.DocumentsDirectory
}
network.request( "https://www.mysite.com/myVideo.mp4", "GET", networkListener, params )
local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 760, 1024 )
webView:request( "page1.html", system.DocumentsDirectory )
I want to know what should i write in page1.html to download and save the file