Tyrel R.
2011-Jul-14 09:50 UTC
Converting an Uploaded File to a string while maintaining binary data
Ok so it boils down to this I uploaded a picture into a ActionDispatch::Http::UploadedFile and want to convert it to a string before I send it off google storage. When I do this it complains about having null characters. I had the same problem when I was experimenting with files from my hard drive with the same function. I was able to do it with: File.open( ''filename'', ''rb'' ) but I don''t know how do read an ActionDispatch::Http::UploadedFile as a binary. Does any one know how to do this? Thank you. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- TypeError: no implicit conversion of Symbol into Hash when submitting form to upload files
- Should to_io be added to ActionDispatch::Http::UploadedFile?
- Cannot get multipart => true , running well in my form when using remote => true
- How to post a file via HTTP as multipart/form-data to Facebook?
- How to retrieve a FileBlob from 'ActionDispatch::Http::UploadedFile' instance?