How to handle the Cefsharp download on Read Only directory where we do not have write permission. #3702
naveenkn01
started this conversation in
General
Replies: 1 comment
-
You will need to handle this scenario yourself, what I suggest is: Prompt the user to save the file, store the user chosen location, download the file to a folder within the users profile (can be the downloads folder, anywhere they are guaranteed to have permission), when the download is complete, move the file to the user chosen location, if the move fails prompt the user asking for another location, move the file there or delete on cancel. Alternatively attempt to create a temp file in the user chosen directory before executing the callback, if unsuccessful prompt the user for another location. Delete temp file if successfully created. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have created a folder with no write permision and trying to download a file.
Its not throwing any exception. How to handle or catch this one?
OnBeforeDownload:
if(folderBrowserDialog.ShowDialog() == DialogResult.OK)
{
using (callback)
{
var path = Path.Combine(folderBrowserDialog.SelectedPath, downloadItem.SuggestedFileName);
var size = downloadItem.TotalBytes;
callback.Continue(path, showDialog: false);
}
Beta Was this translation helpful? Give feedback.
All reactions