emulate RoR web from with cURL?

chirag
Thu, 28 Jun 2007 19:14:43 -0000

I tried the following command
curl -F "uploaded_data=@curltest.docx"
http://localhost:3000/raw_data_files/create

and got the following errors from attachment_fu (file upload plugin)

There were problems with the following fields:
    * Content type can''t be blank
    * Size is not included in the list
    * Size can''t be blank
    * Filename can''t be blank

Here''s my view which works fine on the upload (unlike cURL):
<%= error_messages_for :raw_data_file %>

<% form_for(:raw_data_file, :url => raw_data_files_path, :html =>
{ :multipart => true }) do |form| %>

Upload a file:
    <%= form.file_field :uploaded_data %>


<%= submit_tag "Create" %>
<% end %>

How do I manually set the filename, size, and content type in cURL? It
works fine with the above RoR view.

Chirag


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---