Can anyone help me out with downloading images from the Wlan? I saw the HTTPD code and it looks a bit complicated to SEND, but to recieve it could require some more advanced coding..
If anyone has/can do this, please tell.
Thanks.
Help: Downloading images
Moderators: Shine, Insert_witty_name
Hi, if you want to retive a file from the net, you need to use the HTTP protocol (or the FTP)
Simply send to the server a string like the following:
GET <path&filename> HTTP/1.1\r\n\r\n
Then wait on line end recive the data.
NOTE: I think that on PSP are needed more then
socket:recive() to obtain alla the data.
Simply send to the server a string like the following:
GET <path&filename> HTTP/1.1\r\n\r\n
Then wait on line end recive the data.
NOTE: I think that on PSP are needed more then
socket:recive() to obtain alla the data.
Well, I already know how to retrieve a file, but Im saying how to build it into a PNG file. I have made a program that copies all the lines from a PNG and pastes it into a new PNG, but the PNG isnt working even though if I open it in notepad, it had the same characters. I need to download a PNG and save it.
binary mode
U must READ and WRITE the file in Binary Mode...
If u copy the characters the file will not be the same... Because some characters are not displayed...ETC...
In VB i use: Open "filename.extension" For Binary As #1
well... Google for it and u will find a lot of Stuff...
I hope that helps...
If u copy the characters the file will not be the same... Because some characters are not displayed...ETC...
In VB i use: Open "filename.extension" For Binary As #1
well... Google for it and u will find a lot of Stuff...
I hope that helps...
Thanks a lot!
I found the lua.org booklet thing, and it said that you can inclue an optional 'b' for binary mode. Testing right now, will post results...
EDIT
Nope. Doesnt work. Same results when I make it read + write binary, read binary, or just write binary. Heres my code:
I found the lua.org booklet thing, and it said that you can inclue an optional 'b' for binary mode. Testing right now, will post results...
EDIT
Nope. Doesnt work. Same results when I make it read + write binary, read binary, or just write binary. Heres my code:
Code: Select all
loadtable = ""
function load()
file = io.open("2.png", "rb")
if file then
for line in file:lines() do
loadtable = loadtable..line
end
file:close()
end
end
function save()
file = io.open("3.png", "wb")
if file then
file:write(loadtable)
file:close()
end
end
load()
save()
use
local data = file:read("*a")
it'll load the entire file in binary into the data variable.
There's more info at http://www.lua.org/pil/21.2.2.html on the lua site proper.
local data = file:read("*a")
it'll load the entire file in binary into the data variable.
There's more info at http://www.lua.org/pil/21.2.2.html on the lua site proper.