Forum: Ruby on Rails binary upload and parsing with Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bbdc298cd824989df148bc5312ab4bc3?d=identicon&s=25 chirag (Guest)
on 2007-06-20 01:37
(Received via mailing list)
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?
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2007-06-20 01:53
(Received via mailing list)
On 6/19/07, chirag <patelc75@yahoo.com> 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.

> 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
This topic is locked and can not be replied to.