Uploading a binary file via HTTP?

Hello, I'm trying to implement a neat feature in my app where people can upload pictures they take with their camera to my Linux-based server, hosted on 1&1.

I have implemented the FTP solution and was while it's able to do it, I wanted to know if there's a better way using HTTP, especially with some of the new features recently added.

Basically, there's a lot of issues with FTP in general, whether it's on my hosted end, or in the FTP implementation, such as having to implement a single username and password, which can be sniffed out, port 21 may not be accessible for all users, and my server's permissions allow people the ability to delete and download other files in the folder.

I figure with a good server-side solution in PHP and some implementation in Corona, a good solution can be cobbled together.

i managed to use the code here
http://w3.impa.br/~diego/software/luasocket/old/luasocket-2.0-beta/smtp.html (at the bottom)
to send an image attachment over smtp (you can use a gmx.com smtp account as it doesnt require https), but I havent yet managed to try what you mention above (I wanted to try posting an encoded image to a php script, but not got round to it yet)

1
2
3
4
5
6
7
body = ltn12.source.chain(
        ltn12.source.file(io.open("image.png", "rb")),
        ltn12.filter.chain(
          mime.encode("base64"),
          mime.wrap()
        )
     )
views:1535 update:2011/10/25 9:10:48
corona forums © 2003-2011