mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
WIP Mail REST API: fix docu and content-type of response for uploading attachments
This commit is contained in:
parent
e4b128408f
commit
1bfdb71654
@ -122,9 +122,15 @@ The content of the POST request is the attachment, a Location header in the resp
|
||||
to use in further requests, instead of the attachment.
|
||||
|
||||
```
|
||||
curl -i https://example.org/egroupware/groupdav.php/mail/attachment/<filename> --user <user> \
|
||||
curl -i https://example.org/egroupware/groupdav.php/mail/attachments/<filename> --user <user> \
|
||||
--data-binary @<file> -H 'Content-Type: <content-type-of-file>'
|
||||
HTTP/1.1 204 No Content
|
||||
HTTP/1.1 302 Found
|
||||
Location: https://example.org/egroupware/groupdav.php/mail/attachment/<token>
|
||||
|
||||
{
|
||||
"status": 200,
|
||||
"message": "Attachment stored",
|
||||
"location": "/mail/attachments/<filename>--xM35lY"
|
||||
}
|
||||
```
|
||||
</details>
|
@ -165,6 +165,7 @@ class ApiHandler extends Api\CalDAV\Handler
|
||||
{
|
||||
if (isset($fp)) fclose($fp);
|
||||
header('Location: '.($location = '/mail/attachments/'.substr(basename($attachment_path), 8)));
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([
|
||||
'status' => 200,
|
||||
'message' => 'Attachment stored',
|
||||
|
Loading…
Reference in New Issue
Block a user