Rinnegatamante / lpp-vita

Lua Player Plus for PSVITA. Documentation on: http://rinnegatamante.github.io/lpp-vita/
GNU General Public License v3.0
180 stars 27 forks source link

trying add download #20

Closed modz2014 closed 7 years ago

modz2014 commented 7 years ago

hi I'm trying to download a file using this

-- Checking if connection is available if Network.isWifiEnabled() then

-- Download 
Network.downloadFile("
-- Loading image in memory and deleting it from storage
img = Graphics.loadImage("ud0:/")

I have the other things sort but when I run it gives me error line 2 is there a different line to download a file

Rinnegatamante commented 7 years ago

Your code looks completely faulted. Check it again.

modz2014 commented 7 years ago

-- Initializing Network Network.init()

-- Checking if connection is available if Network.isWifiEnabled() then

-- Download an image
Network.downloadFile("http://rinnegatamante.it/site/images/logo.png", "ux0:/data/data.png")

-- Loading image in memory and deleting it from storage
img = Graphics.loadImage("ux0:/data/data.png")
System.deleteFile("ux0:/data/data.png")

end

-- Terminating network Network.term()

-- Main loop while true do

-- Drawing the downloaded image
Graphics.initBlend()
Screen.clear()
if img == nil then
    Graphics.debugPrint(5,220,"You must enable WiFi to use this sample.", Color.new(255,255,255))
    Graphics.debugPrint(5,240,"Press TRIANGLE to return to the sample selector", Color.new(255,255,255))
else
    Graphics.drawImage(200,265,img)
    Graphics.debugPrint(5,220,"This image came from http://rinnegatamante.it/site/images/logo.png", Color.new(255,255,255))
    Graphics.debugPrint(5,240,"Press TRIANGLE to return to the sample selector", Color.new(255,255,255))
end
Graphics.termBlend()
Screen.flip()

-- Exit check
if Controls.check(Controls.read(), SCE_CTRL_TRIANGLE) then
    if img ~= nil then
        Graphics.freeImage(img)
    end
    img = nil
    break
end

end

modz2014 commented 7 years ago

your one for example in there doesn't not work either error line 2

modz2014 commented 7 years ago

-- Checking if connection is available if Network.isWifiEnabled then

-- Download PUP
Network.downloadFile("https://www.dropbox.com", "ux0:/app/image.img")

end

if System.doesFileExist("ux0:/uriCall_list.txt")==false then System.launchEboot("app0:devkit.bin")

end

modz2014 commented 7 years ago

don't worry about where I downloading it from and too just don't get why there is errors

modz2014 commented 7 years ago

Or what's the lines for moving a file scr to dest path

Rinnegatamante commented 7 years ago

I still don't get what's the problem, you're spamming random stuffs badly formatted that are hard to understand.

Btw, you're trying to download dropbox home (?) for what purpose? Also, according to the fact you're trying to save the result on ux0:/app, i suppose you're using the unsafe build cause if not, safe build can write only on ux0:/data.

modz2014 commented 7 years ago

Yes of cause unsafe don't worry about what I'm Dowloading I'm asking if it's right coz I get error at line too

If It can't be done is there away for moving a file

Rinnegatamante commented 7 years ago

What error?

modz2014 commented 7 years ago

Line two errror look at your same code for downloading image it's the same error

Rinnegatamante commented 7 years ago

The sample works fine and since you dont want to cooperate, i cant help you.

modz2014 commented 7 years ago

I said I'm trying to create a script to download a file from dropbox then save it to a path ive tried heaps of was using http but I keep getting errors