React
useFileUpload()
API Documentation
Backend Services
- Authentication
- Storage
GraphQL
- AI
Client Libraries
- JavaScript
- React
- NhostClient
- <SignedIn />
- <SignedOut />
- useAccessToken()
- useAddSecurityKey()
- useAuthenticated()
- useAuthenticationStatus()
- useChangeEmail()
- useChangePassword()
- useConfigMfa()
- useDecodedAccessToken()
- useFileUpload()
- useFileUploadItem()
- useHasuraClaim()
- useHasuraClaims()
- useMultipleFilesUpload()
- useNhostClient()
- useProviderLink()
- useResetPassword()
- useSendVerificationEmail()
- useSignInAnonymous()
- useSignInEmailPassword()
- useSignInEmailPasswordless()
- useSignInEmailSecurityKey()
- useSignInPAT()
- useSignInSmsPasswordless()
- useSignOut()
- useSignUpEmailPassword()
- useSignUpEmailSecurityKeyEmail()
- useElevateSecurityKeyEmail()
- useUserAvatarUrl()
- useUserData()
- useUserDefaultRole()
- useUserDisplayName()
- useUserEmail()
- useUserId()
- useUserIsAnonymous()
- useUserLocale()
- useUserRoles()
- useSignInEmailOTP()
- useSignInIdToken()
- useLinkIdToken()
- Next.js
- Vue
- React Native
React
useFileUpload()
Use the hook useFileUpload
to upload a file.
const {
add,
upload,
cancel,
isUploaded,
isUploading,
isError,
progress,
id,
bucketId,
name
} = useFileUpload()
const handleFormSubmit = async (e) => {
e.preventDefault()
await upload({ file })
}