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?

On 6/19/07, chirag [email protected] wrote:

  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.

  1. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs