feat: refine sftp pane upload workflow
This commit is contained in:
@@ -27,11 +27,11 @@ export async function downloadFile(connectionId: number, path: string, downloadN
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
export function uploadFile(connectionId: number, path: string, file: File) {
|
||||
export function uploadFile(connectionId: number, path: string, file: File, options?: { overwrite?: boolean }) {
|
||||
const form = new FormData()
|
||||
form.append('file', file, file.name)
|
||||
return http.post<{ taskId: string; message: string }>('/sftp/upload', form, {
|
||||
params: { connectionId, path },
|
||||
params: { connectionId, path, overwrite: options?.overwrite ?? false },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user