mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
⬇️ refactor: Assistant File Downloads (#2364)
* refactor(getFiledownload): explicit accept of `application/octet-stream` * chore: test compose file * chore: test compose file fix * chore(files/download): add more logs * Fix proxy_pass URLs in nginx.conf * fix: proxy_pass URLs in nginx.conf to fix file downloads from URL * chore: move test compose file to utils dir * refactor(useFileDownload): simplify API request by passing `file_id` instead of `filepath`
This commit is contained in:
parent
cc71125fa1
commit
cb64b84846
6 changed files with 92 additions and 20 deletions
|
|
@ -202,10 +202,12 @@ export const uploadAssistantAvatar = (data: m.AssistantAvatarVariables): Promise
|
|||
);
|
||||
};
|
||||
|
||||
export const getFileDownload = async (userId: string, filepath: string): Promise<AxiosResponse> => {
|
||||
const encodedFilePath = encodeURIComponent(filepath);
|
||||
return request.getResponse(`${endpoints.files()}/download/${userId}/${encodedFilePath}`, {
|
||||
export const getFileDownload = async (userId: string, file_id: string): Promise<AxiosResponse> => {
|
||||
return request.getResponse(`${endpoints.files()}/download/${userId}/${file_id}`, {
|
||||
responseType: 'blob',
|
||||
headers: {
|
||||
Accept: 'application/octet-stream',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue