Skip to content
Snippets Groups Projects
Commit 037f5dbe authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[REF]: Improved code in advanced dropzone example for testing upload

parent 5797c2d0
Branches
Tags
No related merge requests found
...@@ -56,6 +56,16 @@ export default function AdvancedDropzoneDemo() { ...@@ -56,6 +56,16 @@ export default function AdvancedDropzoneDemo() {
} }
} }
const handleAbort = (id) => { const handleAbort = (id) => {
// alert(id);
setExtFiles(
extFiles.map((ef) => {
if (ef.id === id) {
return { ...ef, uploadStatus: "aborted" };
} else return { ...ef };
})
);
};
const handleCancel= (id) => {
// alert(id); // alert(id);
setExtFiles( setExtFiles(
extFiles.map((ef) => { extFiles.map((ef) => {
...@@ -107,6 +117,7 @@ export default function AdvancedDropzoneDemo() { ...@@ -107,6 +117,7 @@ export default function AdvancedDropzoneDemo() {
onSee={handleSee} onSee={handleSee}
onWatch={handleWatch} onWatch={handleWatch}
onAbort={handleAbort} onAbort={handleAbort}
onCancel={handleCancel}
resultOnTooltip resultOnTooltip
alwaysActive alwaysActive
preview preview
......
...@@ -41,11 +41,12 @@ const DropzoneMainPage = ({ darkMode = false }) => { ...@@ -41,11 +41,12 @@ const DropzoneMainPage = ({ darkMode = false }) => {
// minHeight="400px" // minHeight="400px"
onChange={updateFiles} onChange={updateFiles}
value={files} value={files}
maxFileSize={28*1024} maxFileSize={28 * 1024 * 10}
maxFiles={5} maxFiles={5}
accept=".jpg, .png, application/json, video/*" accept=".jpg, .png, application/json, video/*"
fakeUpload fakeUpload
behaviour="add" behaviour="add"
uploadConfig={{ autoUpload: true , url:"fdbd"}}
//uploadConfig={{ autoUpload: true, url:"fdbd" }} //uploadConfig={{ autoUpload: true, url:"fdbd" }}
> >
{files.length > 0 && {files.length > 0 &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment