binary upload and parsing with Rails

1. What is the best way for me to upload a binary file to a Rails site? I'll be uploading from a .NET client.

2. What is the best way to parse the binary file to extract the data? Would I need to "drop" to C and read the binary file that way?

1. What is the best way for me to upload a binary file to a Rails site? I'll be uploading from a .NET client.

Do a PUT request with Content-Type: application/octet-stream, Content-Length: yourfilesize, and send the file verbatim as the request body.

2. What is the best way to parse the binary file to extract the data? Would I need to "drop" to C and read the binary file that way?

Read the body using request.raw_post

jeremy