Upload screen capture to website

Can this be done? To upload an image of the screen capture to a web server?

I am able to upload an image to the server if It is in the game file directory and I specify the name, this work fine, uploads, replaces the original.

What I require is to be able to do this from a screencapture. Trouble is this saves it to photo gallery and also I would not know the name of the file. I have looked at display.save but this again seems it may not be possible as it saves to the system.DocumentsDirectory so I am having trouble accessing it.

I think it may be easier to rename the file once it has been uploaded onto the server…

[code]

function upload()

local path = “entireScreen.jpg”
uploadBinary (path, “http://www.polishedpixel.net/magnetype/upload/upload.php”, networkListener)
end

function uploadBinary ( filename, url, onComplete )
local mime = require “mime”
–local path = system.pathForFile( filename )
local path = system.pathForFile( filename )

local fileHandle = io.open( path, “rb” )
if fileHandle then
local params = {
body = “image_file=” … mime.b64( fileHandle:read( “*a” )) … “&image_filename=”…filename
}
io.close( fileHandle )

local function networkListener ( event )
if (onComplete) then
onComplete(event);
end
return true;
end

network.request( url, “POST”, networkListener, params)
end
end

[/code] [import]uid: 21298 topic_id: 17550 reply_id: 317550[/import]

Hi . I’ve successfully used media.show() media.save() network.request() to do the job.

However there are some unknown errors prevented me from saving oertain screenshots to temporary folder. Also in the newest build 691, there seems a media.show() bug on iPhone & iPod touch. Until those bugs are fixed, I guess we cannot really do anything… [import]uid: 4992 topic_id: 17550 reply_id: 69314[/import]

your problem is get the image from DocumentsDirectory?

local path = system.pathForFile( filename, system.DocumentsDirectory )  

now you can catch the photo that you have saved with screencapture

it that your problem?

Dhennrich [import]uid: 23063 topic_id: 17550 reply_id: 69316[/import]

@josh_pixel Could you please share php code at server side ?

Thx…
[import]uid: 39186 topic_id: 17550 reply_id: 73517[/import]