problem with attachement_fu on sinatra

G

Ganesh Kathare

Hello experts,

I am trying to user attachement_fu plugin on sinatra..

When I'm posting request on sinatra.. including file params

then in log it showing posted params[:file] format in hash type.. like

{"uploaded_data"=>
{:filename=>"user.JPG",
:type=>"image/jpeg",
:name=>"custom_thumbnail[uploaded_data]",
:tempfile=>
#<File:C:/DOCUME~1/Nishant/LOCALS~1/Temp/RackMultipart4072-15639>,
:head=>
"Content-Disposition: form-data;
name=\"custom_thumbnail[uploaded_data]\";
filename=\"user.JPG\"\r\nContent-Type: image/jpeg\r\n"}}




instead of as attachement_fu needs it request file params as like

{"uploaded_data"=>
#<ActionDispatch::Http::UploadedFile:0x1434
@content_type="image/jpeg",
@headers=
"Content-Disposition: form-data;
name=\"custom_thumbnail[uploaded_data]\";
filename=\"user.JPG\"\r\nContent-Type: image/jpeg\r\n",
@original_filename="user.JPG",
@tempfile=
#<File:C:/DOCUME~1/Nishant/LOCALS~1/Temp/RackMultipart4072-15640>>}




Due to above has_type format attachement_fu is not supporting..

it showing errors like

undefined method 'content_type' and all other....


Any ideas..? on how to get this to change/access params format as normal
format(like action_controller params)?


Thank you in advance

-Ganesh K
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top