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);
}
-
Notifications
You must be signed in to change notification settings - Fork 24
ManishBisht777/file-vault
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published