when I tried below, it worked
<form
target="upload_iframe"
action="/profile/validate_charts_file"
id="upload_charts"
method="post"
enctype="multipart/form-data">
<input type="file" name="charts_file"
id="filename" />
<input type="button" name="submit"
class="button_light" value="Upload"
/>
</form>
<iframe id="upload_iframe" name="upload_frame"
style="display:
none"></iframe>
I could receive the file at server end through params[:charts_file].
Now i wanted to have it ajax so I just added the ''onSubmit''
like below,
and it didnt work ...
<form
target="upload_iframe"
action="/profile/validate_charts_file"
id="upload_charts"
onsubmit="new
Ajax.Request(''/profile/validate_charts_file'',
{asynchronous:true, evalScripts:true,
parameters:Form.serialize(this)});return false;"
method="post"
enctype="multipart/form-data">
<input type="file" name="charts_file"
id="filename" />
<input type="button" name="submit"
class="button_light" value="Upload"
/>
</form>
<iframe id="upload_iframe" name="upload_frame"
style="display:
none"></iframe>
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---