Feature #12125

Set filename used to store attachment updloaded via the REST API

Added by Hannes Meier over 5 years ago. Updated almost 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:


Category:REST API
Target version:2.2.0


i upload a lot of jpegs for every project via rest-api.
When a project it finished it would be great if i could zip the projectattachements.

Therefore it would be great if my uploadfilenames would be adoptet for the files.

At the moment my api-uploaded files have a timestamp (and the token?) as filename. Even no fileextension.


Manually uploaded files have the timestamp and their uploadedname, like:

Am i using the rest-api wrong or is this feature not included yet?

my reduced python example:

url = self.__url("uploads.json")
headers = {'content-type': 'application/octet-stream'}
data = open(attachment).read()
r = requests.post(url, data = data, headers = headers)
token = json.loads(r.text)
token = token['upload']['token']


payload = dict(
    issue = dict (
        uploads = dict (
            upload = dict (
                token = token,
                filename = filename,
r = requests.put(self.__url("issues/"+str(ticketid)+".json"), data = json.dumps(payload), headers = self.header)

Associated revisions

Revision 10678
Added by Jean-Philippe Lang about 5 years ago

Let the attachment filename be specified on upload (#12125).


#1 Updated by Jean-Philippe Lang about 5 years ago

  • Tracker changed from Defect to Feature
  • Subject changed from REST-API: Own Filename for uploaded files via API to Set filename used to store attachment updloaded via the REST API
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.2.0

There's no option for now to set the actual file name of the attachment when uploading via the rest API.

#2 Updated by Jean-Philippe Lang about 5 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Implemented in r10678. You can now POST to /uploads.xml?filename=image.jpeg to set the filename of your attachment on the file system.

#3 Updated by Hannes Meier about 5 years ago

wow! that was fast!
thank you very much.
great help!

#4 Updated by Simple Dino almost 2 years ago

It would be really great to update the documentation ;)

Also available in: Atom PDF