mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 09:03:19 +08:00
fix: improve HuggingFace large file upload
- Fix commitUpload missing url parameter for endUpload - Implement incremental SHA256 hash algorithm for large files - Use 4MB chunks for SHA256 calculation to reduce memory pressure - Support files of any size without memory overflow
This commit is contained in:
@@ -113,10 +113,13 @@ export async function onRequestPost(context) {
|
||||
await db.put(fullId, "", { metadata });
|
||||
|
||||
// 结束上传(更新索引等)
|
||||
// 构造 url 对象用于 endUpload
|
||||
const url = new URL(request.url);
|
||||
const uploadContext = {
|
||||
env,
|
||||
waitUntil,
|
||||
uploadConfig
|
||||
uploadConfig,
|
||||
url
|
||||
};
|
||||
waitUntil(endUpload(uploadContext, fullId, metadata));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user