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| %> <p> <label for="uploaded_data">Upload a file:</label> <%= form.file_field :uploaded_data %> </p> <p> <%= submit_tag "Create" %> </p> <% 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 -~----------~----~----~----~------~----~------~--~---
> 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| %> > <p> > <label for="uploaded_data">Upload a file:</label> > <%= form.file_field :uploaded_data %> > </p> > > <p> <%= submit_tag "Create" %> </p> > <% end %>Are you sure "uploaded_data" is the name of the *HTML* field that your view produces? I think it''s gonna really be "raw_data_file[uploaded_data]". So your curl test is getting a blank upload and all those errors are because that information about your file (which it never got) is missing. -philip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---