This code was intended to be a proof-of-concept, and therefore is neither robust nor extremely well-written. SocketUpload is primarily intended for sending POST requests to SimpleHTTPServerWithUpload. socket_upload_ssl makes SSL-encrypted PUT requests to an Amazon S3 bucket.
SimpleHTTPServerWithUpload.py- Extension of Python'sSimpleHTTPServer. All credit goes to Tao Huang.SocketUpload.java- Uses theSocketChannelclass to upload a file using a generic PUT or POST request to a given hostname.socket_upload_ssl.cpp- C++ code that uses the PolarSSL library to upload a file to an Amazon S3 bucket using a PUT request.Makefile- Compile/clean the code.
SocketUploadwas only tested againstSimpleHTTPServerWithUpload.socket_upload_sslwas only tested against a completely barebones S3 bucket.- PUT operations via
SocketUploadwere not tested becauseSimpleHTTPServerWithUploaddoes not support it. - When using
SocketUploadto POST toSimpleHTTPServerWithUpload, the server's response is not returned correctly (regardless of whether the upload was successful). SocketUploadusesSocketChanneland lacks SSL support because it was written to run against Avian rather than the JVM- The code always PUTs/POSTs to the filesystem root (no subdirectories).
socket_upload_ssldoes not handle any Amazon-specific header elements and only supports virtual hosted-style hostnames (i.e. bucketname.s3.amazonaws.com).socket_upload_ssldoes not send the MD5 hash of the request contents.