API Reference
useConvexUpload
Reference for the shared upload wrapper built on top of useConvexStorage.
useConvexUpload wraps the upload flow around useConvexStorage.
Import
Nuxt
const { upload, isUploading, progress, error } = useConvexUpload()
Vue
import { useConvexUpload } from 'vue-convex/storage'
Signature
function useConvexUpload(options?: {
generateUploadUrl?: () => Promise<string>
onSuccess?: (storageId: string, file: File) => void | Promise<void>
onError?: (error: Error) => void
}): {
upload: (file: File) => Promise<string | null>
isUploading: Readonly<Ref<boolean>>
progress: Readonly<Ref<number>>
error: Readonly<Ref<Error | null>>
}
Behavior
- Client-only; calling
upload()during SSR returnsnulland sets an error - Uses
fetch()to send the file to the signed upload URL - Sets
progressto0before the request and100after success - Does not expose byte-level incremental upload progress