View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Upload attachment file using API - ProjeQtOr
 

Upload attachment file using API

More
04 Dec 2025 15:59 - 04 Dec 2025 16:07 #1 by MagicBuzz
Hello,

I'm using the REST API to create tickets from a custom tool, and it works fine.

Now I want to add some files (logs, configuratuon files, etc.) to the created tickets.

I tried using this query :

{ "refType": "Ticket", "refId": "1234", "description": "Fichiers du mobile", "fileName": "bupreport.zip", "file": "{Convert.ToBase64String(zip)}" }

It creates an attachment, but I can't see the file, it looks like it wasn't uploaded.
I'm not sure how I should provide the file contents.
I tried encoding the file in base64 in a field "file" but it looks like to be ignored.

I tried as a multipart request too, but it fails.

var content = new MultipartFormDataContent();
content.Add(new StringContent("Ticket"), "refType");
content.Add(new StringContent(ticket.Id.ToString()), "refId");
content.Add(new StringContent("BugReport"), "description");
content.Add(new StringContent("bupreport.zip"), "fileName");
content.Add(byteArrayContent, "data", "bugreport.zip");


How can I do ?

If it's impossible, how can I upload an attachment using a regular HTTP POST request like the browser uses when we send a file from the HTML GUI?
Last edit: 04 Dec 2025 16:07 by MagicBuzz.

Please Log in or Create an account to join the conversation.

More
12 Dec 2025 15:49 #2 by babynus
The API is not designed to upload files.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.030 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.