Abort not working on autoUpload = false OR Who to remove one file from the List?
See original GitHub issueDescribe the bug When autoUpload is false and abort is called the item will not be removed .
Expected behavior Abort deletes the file from the list OR a remove method is provided.
Versions “@rpldy/uploady”: “^0.8.3”, “@rpldy/upload-drop-zone”: “^0.8.3”, “@rpldy/uploader”: “^0.8.3”, “@rpldy/sender”: “^0.8.0”, “@rpldy/shared”: “^0.8.0”,
Code
const FileItems = () => {
const abort = useItemAbort();
const [files, setFiles] = useState([]);
useBatchAddListener((batch: Batch) => {
setFiles(prevState => [...prevState, ...batch.items]);
});
useItemAbortListener((batch: BatchItem) => {
debugger;
});
useBatchAbortListener(batch => {
debugger;
});
useAllAbortListener(() => {
debugger;
});
return files.map(file => <FileItem file={file} onClick={() => abort(file.id)} />)
}
const App = () => {
return <Uploady autoUpload={false} >
<FileItems />
</Uploady
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
How can i remove some file from fineuploader before upload
To remove a file (before it has started or completed uploading), simply cancel it via the cancel API method. For example:
Read more >Remove a file from async upload list. in Kendo UI for jQuery
I have a kendo upload on one of my forms. This upload button has the following async, multiselect, autoUpload = false, batch =...
Read more >Upload component throws NPE upload.setAutoUpload ...
setAutoUpload(false); and click "x" to remove file in the list Steps to reproduce Create Upload, select multiple files and click to remove ......
Read more >Options Core
When true the cancel link does not appear next to files when the form uploader is used. Type: Boolean. Default Value: false. formatFileName....
Read more >Why is my Hero 10 unable to auto upload to the cloud?
Sorry to hear you're experiencing issues with the Auto Upload on your GoPro. Please try the following: Run a factory reset in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I wouldnt like to expose the uploader instance unless there’s a very strong case for it
In any case, Ive a solution I believe will work nicely. Abort will take care of pending uploads and Uploady context will have the clearPending method available.
This way you’ll be able to cancel individual (pending) uploads or all of them together
Thank you for your Response and for accepting it as an enhancement,
yes line 43 was a mistake, i was in a hurry…
i also prefer an solution wich modifies the abort method. With an extra method for that usecase i had to evaluate the current files state instead of simply aborting it.
As an alternativ to exposing the Uploder instance, could the Uplody take a prop “instance” wich takes in an custom Uploder Instance? or maybe an higher order Component
withCustomUploder