Project

General

Profile

Actions

Defect #13713

closed

File attachment is broken with REST API XML format

Added by TANUKI M over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

example case

POST /issues.xml
<issue>
  <project_id>1</project_id>
  <subject>Creating an issue with a uploaded file</subject>
  <uploads type="array">
    <upload>
      <token>7167.ed1ccdb093229ca1bd0b043618d88743</token>
      <filename>image.png</filename>
      <description>An optional description here</description>
      <content_type>image/png</content_type>
    </upload>
  </uploads>
</issue>

in 'app/controllers/issues_controller.rb'

   params[:issue][:uploads] # => [{"upload"=>{"content_type"=>"image/png", "description"=>"An optional description here", "filename"=>"image.png", "token"=>"7167.ed1ccdb093229ca1bd0b043618d88743"}}}

so, never be true in 'lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb'

               elsif token = attachment['token']

attachment['upload']['token'] is true

Actions

Also available in: Atom PDF