mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Improve file api
This commit is contained in:
@@ -422,17 +422,14 @@ class Network {
|
||||
}
|
||||
}
|
||||
|
||||
async uploadFileBlock(fileId: number, index: number, blockData: Blob): Promise<Response<any>> {
|
||||
async uploadFileBlock(fileId: number, index: number, blockData: ArrayBuffer): Promise<Response<any>> {
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('block', blockData);
|
||||
|
||||
const response = await axios.post(
|
||||
`${this.apiBaseUrl}/files/upload/block/${fileId}/${index}`,
|
||||
formData,
|
||||
blockData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
'Content-Type': 'application/octet-stream',
|
||||
}
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user