Function: uploadBlob()
uploadBlob(
agent,file):Promise<UploadBlobResult>
Defined in: web/lib/atproto/record-creator.ts:151
Upload a file blob to the user's PDS.
Parameters
agent
Agent
Authenticated ATProto Agent
file
File
File to upload
Returns
Promise<UploadBlobResult>
Upload result with BlobRef
Remarks
Uploads the file to the authenticated user's PDS. Returns a BlobRef that can be used in ATProto records.
Throws
Error if agent is not authenticated
Throws
Error if upload fails
Example
const agent = useAgent();
if (!agent) throw new Error('Not authenticated');
const result = await uploadBlob(agent, pdfFile);
console.log('Uploaded:', result.blobRef);