# Help with rjb

**URL:** <https://www.ruby-forum.com/t/help-with-rjb/87773>\
**Category:** Rails\
**Created:** [March 5, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/help-with-rjb/87773 "2007-03-05T22:23:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [March 5, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/help-with-rjb/87773/1 "2007-03-05T22:23:59Z")

</div>

I am trying to do file i/o with rails and rjb and can’t figure out a  
way to make this work. Here’s what I am trying to do:

- a user uploads an image to the server via a standard html form:  
\<%= file\_field(“blog”, “attach”) %\>
- this returns a ruby File object to the controller in  
params[:blog][:attach]

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [March 5, 2007, 10:33pm UTC](https://www.ruby-forum.com/t/help-with-rjb/87773/2 "2007-03-05T22:33:00Z")

</div>

raf wrote:

> I am trying to do file i/o with rails and rjb and can’t figure out a  
> way to make this work. Here’s what I am trying to do:
> 
> - a user uploads an image to the server via a standard html form:  
> \<%= file\_field(“blog”, “attach”) %\>
> - this returns a ruby File object to the controller in  
> params[:blog][:attach]

Are you POSTing the “standard form”? Or by RJS do you mean you are  
trying to use Ajax?

Standard Ajax cannot send a file. Try this system:

> –  
> Sébastien Grosjean - ZenCocoon

–  
Phlip  
[http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [March 5, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/help-with-rjb/87773/3 "2007-03-05T22:37:01Z")

</div>

Thanks for your response. My original post was incomplete and sent in  
error. Please see the subsequent post for a more full (hopefully  
better) explanation of what I am trying to do.

PS - Ajax is not involved at all. This is a question about rjb (Ruby/  
Java bridge)
