I am using file field
control for upload image like below:
<%= form_for(:ImageUpload, :html => { :id => "imageupload" }) do |f| %>
<table width="100%">
<tr>
<td align="left">
<%= file_field( "upload", "datafile") %>
</td>
</tr>
</table>
<table width="92%">
<tr>
<td align="center">
<div class="button" style="margin-right:60px;">
<%= f.submit "Next", { :class => "buttonSearch"} %>
</div>
</td>
</tr>
</table>
<% end %>
controller page:
def create
get_img_path = params[:upload][:datafile].path
@blah = get_img_path
render 'new'
end
And I want to get sever path of the uploaded image and also want to change the server path of the image into this app/assets/upload
because I want to store the uploaded image at this path app/assets/uploaded
.
Kindly suggest me, waiting for your reply.
Thanks.