mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-07 03:48:44 +08:00
Refa: migrate document preview/download to RESTful API (#14633)
### What problem does this PR solve? migrate document preview/download to RESTful API ### Type of change - [x] Refactoring
This commit is contained in:
@@ -6879,14 +6879,18 @@ Failure:
|
||||
##### Request example
|
||||
|
||||
```bash
|
||||
```
|
||||
curl --request GET \
|
||||
--url 'http://{address}/api/v1/documents/{doc_id}/download?ext=pdf' \
|
||||
--header 'Authorization: Bearer <YOUR_API_KEY>' \
|
||||
--output ./downloaded_attachment.pdf
|
||||
```
|
||||
|
||||
##### Request parameters
|
||||
|
||||
- `doc_id`: (*Path parameter*), `string`, *Required*
|
||||
The document ID whose attachment should be downloaded.
|
||||
- `ext`: (*Query parameter*), `string`, *Optional*
|
||||
A file extension hint specifying the response's Content-Type. Defaults to `"markdown"`. Available values:
|
||||
A file extension hint specifying the response's Content-Type. Defaults to `"markdown"`. Available values:
|
||||
- `"markdown"`
|
||||
- `"html"`
|
||||
- `"pdf"`
|
||||
@@ -6896,15 +6900,15 @@ Downloads a runtime attachment previously uploaded via the [Upload document](#up
|
||||
|
||||
#### Response
|
||||
|
||||
Success:
|
||||
Success:
|
||||
|
||||
Returns the file content as a binary stream with the relevant Content-Type header.
|
||||
|
||||
Failure:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 500,
|
||||
{
|
||||
"code": 500,
|
||||
"message": "Internal server error"
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user