Hey Guys,
I created a web site where I could upload videos, it’s built using RoR
and RESTful urls. Videos#create lets me upload videos.
Next, I created another app, which using activeresource to interact
with the first site. So, I want the user to upload a file to the
client app, which then posts it via activeresource to the server app.
In the client app I get the file, but then I try to do this:
video_file = File.open params[:clip][:file].local_path, “r”
clip = Clip.new(:name => params[:clip][:name],
:description => params[:clip][:description],
:file => video_file)
Clip is the ActiveResource object for the server. On the server
params[:clip][:file] comes out null.
Let me reply to the answers I expect to come up in advance:
- No, I cannot have the client post directly to the server
- I tried Base64 encoding the data and sending as a string, but it
takes incredibly long to convert and post 100 megs of video via
Base64. I figure if the user can send to the client in binary, then
the client should be able to send to the server the same way.
Thanks