Rianú Dul Chun Cinn Uaslódála le Cláraíochtaí
Tar éis duit comhad a uaslódáil chuig an URL S3 réamhshínithe, leanann an t-ardán air ag próiseáil go asynchronúil.
Bain úsáid as subscribeUserFeed chun imeachtaí uaslódála i bhfíor-am a fháil seachas suirbhé a dhéanamh go leanúnach.
Má níl ort imeachtaí fíor-ama a fháil, is féidir leat an réimse fileUploaded den teimpléad a suirbhéireacht go dtí go ngearrtar true.
Chun an scéim ghinearálta imeachta a fheiceáil, féach Formáid Imeachta Cláraíochta.
Soláthar agus Catagóir
Brúightear imeachtaí uaslódála ar:
subscribeUserFeed
Úsáidtear iad le:
category: "upload"
Ainmneacha Imeachtaí
Scaoileann próiseáil uaslódála sraith imeachtaí mar shampla:
uploadScanneduploadTypeCheckeduploadConvertinguploadFlatteneduploadTagsParseduploadPdfMetaExtracteduploadCompleteduploadFailed
Taisce Imeachta Uaslódála
Úsáideann taisceanna uaslódála an cruth bonn seo:
{
"version": "1.0",
"eventId": "evt...",
"timestamp": "2026-04-24T10:38:36.822Z",
"level": "INFO",
"event": "uploadCompleted",
"category": "upload",
"groupId": null,
"userId": "usr...",
"requestId": null,
"batchId": null,
"error": null,
"data": {
"id": "tmp...",
"key": "upload/usr.../tmp....pdf",
"code": "UPLOADOK"
}
}
Coinníonn data.code an cód próiseála níos ísle le linn trasfhoirmithe agus comhoiriúnachta.
Oibríocht Cláraíochta
subscription SubscribeUserFeed {
subscribeUserFeed {
userId
data
}
}
Sampla JavaScript
const parseEnvelope = (payload) => {
const raw = payload?.data;
if (!raw) return null;
return typeof raw === 'string' ? JSON.parse(raw) : raw;
};
const handleUserFeed = ({ data }) => {
const wrapper = data?.subscribeUserFeed;
const event = parseEnvelope(wrapper);
if (event?.category !== 'upload') return;
switch (event.event) {
case 'uploadCompleted':
console.log('upload complete', event.data.id, event.data.key);
break;
case 'uploadFailed':
console.error('upload failed', event.data.code, event.data.key);
break;
default:
console.log('upload progress', event.event, event.data.code);
}
};
Cathain le Húsáid
Is an-úsáideach é seo nuair atá tú ag iarraidh:
- taispeáint druileála dul chun cinn nó amlíne stádas uaslódála
- teipí fíoraithe asynchronúla a bhrath tar éis do PUT S3 a bheith rathúil
- freagairt láithreach nuair a bhíonn teimpléad nó acmhainn uaslódáilte réidh