Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ManishBisht777/file-vault
https://github.com/ManishBisht777/file-vault
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ManishBisht777/file-vault
- Owner: ManishBisht777
- Created: 2024-02-17T11:02:42.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-05-09T11:32:28.000Z (8 months ago)
- Last Synced: 2024-06-14T18:40:33.117Z (7 months ago)
- Language: TypeScript
- Homepage: https://file-vault-delta.vercel.app
- Size: 77.1 KB
- Stars: 201
- Watchers: 2
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-shadcn-ui - file-vault - File upload component built with shadcn/ui. (Libraries and components:)
README
### File upload component
![image](https://github.com/ManishBisht777/file-vault/assets/89926834/777ab136-0a9f-4657-b098-d4fb680b9608)### Cloudinary upload helper function
```
const fileUploadBatch = acceptedFiles.map((file) => {
const formData = new FormData();
formData.append("file", file);
formData.append(
"upload_preset",
process.env.NEXT_PUBLIC_UPLOAD_PRESET as string
);const cancelSource = axios.CancelToken.source();
return uploadImageToCloudinary(
formData,
(progressEvent) => onUploadProgress(progressEvent, file, cancelSource),
cancelSource
);
});try {
await Promise.all(fileUploadBatch);
alert("All files uploaded successfully");
} catch (error) {
console.error("Error uploading files: ", error);
}
```