You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-12-21 15:43:47

little_devil
Member
Registered: 2024-12-09
Posts: 7

How to create TicketFollowup with an image through its URL?

I make POST-request from Postman:
apirest.php/TicketFollowup

Headers:
Session-Token: blablabla
Content-Type: multipart/form-data

Body - form-data:

key: value:

uploadManifest:

{
  "input": {
    "tickets_id": 15,
    "content": "Photo 3"
  }
}

filename[0]:
type: file
value: uploaded from PC - 142 Kb.

Response:

{
    "id": 16,
    "message": "Document copy succeeded.",
    "upload_result": {
        "filename": [
            {
              ...
            }
        ]
    }
}

201 - Created

But now I wanna do another request with one change:
filename[0]:
type: text
value: url of image (image - 142 Kb still, at least, when I download it)

Response:

[
    "ERROR_UPLOAD_FILE_TOO_BIG_POST_MAX_SIZE",
    "The file seems too big"
]

400 Bad Request

I've seen another duscussions about this topic:
forum.glpi-project.org/viewtopic.php?id=282629
forum.glpi-project.org/viewtopic.php?id=176544
forum.glpi-project.org/viewtopic.php?id=209103

I checked:
- I have the right syntax;
- it's not about size really, only 142 Kb;
- in my PHP and Apache settings at least 2 Mb are allowed.

I don't understand, why this error appers.

Offline

#2 2024-12-24 03:19:08

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,226
Website

Re: How to create TicketFollowup with an image through its URL?

As far as I know, uploading a file from a URL is not supported at all.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

Board footer

Powered by FluxBB