Open hupo376787 opened 4 weeks ago
I was able to download the file without any issues. However, I have two suggestions for you:
File Path Format : Please ensure that the file path you provided is correct. In Windows OS, the path should be formatted as "d:\aa.jpg" instead of "d:/aa.jpg".
Error Handling : Please add the following code to your downloader object to catch any errors during the download process:
downloader.DownloadFileCompleted += (sender, args) => {
if (args.Cancelled)
Console.WriteLine("Download Canceled.");
if (args.Error is not null) {
Console.WriteLine("Error: " + args.Error.Message);
if (args.Error.InnerException != null)
Console.Error.WriteLine("Inner Exception: " + args.Error.InnerException.Message);
}
};
This will help you diagnose any issues that may arise during the download. If you have any further questions, feel free to ask!
Hi, sorry for the late reply. I catch the error using your code.
Error: The SSL connection could not be established, see inner exception.
Inner Exception: The SSL connection could not be established, see inner exception.
It seems my network problem.
Hi, I tried another project, https://github.com/rogerfar/Downloader.NET It can download the image.
string url = "https://pbs.twimg.com/media/GbLEYYyWYAAE767.jpg";
string path = "result.jpg";
var downloader0 = new DownloaderNET.Downloader(url, path);
await downloader0.Download();
Now it seems that the inner exception did exit.
No error, no file downloaded