Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownloadStatus is Failed but no exception is thrown #161

Open
milkywayfarer opened this issue Jan 20, 2024 · 2 comments
Open

DownloadStatus is Failed but no exception is thrown #161

milkywayfarer opened this issue Jan 20, 2024 · 2 comments

Comments

@milkywayfarer
Copy link

Steps to reproduce:

  1. Create a configuration and a client:
    DownloadConfiguration configuration = new DownloadConfiguration()
    {
        MaxTryAgainOnFailover = int.MaxValue,
        Timeout = int.MaxValue,
        MaximumBytesPerSecond = (Variables.limiter * 1024 * 1024) / 8,
        ParallelDownload = true,
        ChunkCount = 1,
        MaximumMemoryBufferBytes = 1024 * 1024 * 1024 / Variables.threadLimiter,
        ReserveStorageSpaceBeforeStartingDownload = true,
    };
    var client = new DownloadService(configuration);
    try
    {
        await client.DownloadFileTaskAsync(item.From.ToString(), new DirectoryInfo(Path.GetDirectoryName(path)!), ct);
    }
    catch (Exception e)
    {
        ...
    }
    
  2. Download a file from this URL. Scheme does not matters, link works for http and https both (we prefer http).
  3. After some amount of time (around 5 secs), function returns with no output and client.Status == DownloadStatus.Failed.
@aravindk777
Copy link

I also have the same issue.

@ZCOREP
Copy link

ZCOREP commented Mar 24, 2024

same issue! this is my code
my file is create but nothing download,
iam using 3.0.6 version!

    public async void dlimage(string videoname, string imageuri)
    {
        var folder = await KnownFolders.VideosLibrary.CreateFolderAsync("testfolder", CreationCollisionOption.OpenIfExists);
        var editShode = Regex.Replace(videoname, "[\\/:*?\"<>|]", string.Empty);
        var file = await folder.CreateFileAsync(editShode, CreationCollisionOption.GenerateUniqueName); 
        var downloadOpt = new DownloadConfiguration()
        {
            ChunkCount = 2, // file parts to download, default value is 1 
            ParallelDownload = true // download parts of file as parallel or not. Default value is false
        };
        var downloader = new DownloadService(downloadOpt);            
        Stream destinationStream = await downloader.DownloadFileTaskAsync(imageuri);
        if (destinationStream != null)
        {
            var bytesstream = await GetBytes(destinationStream);
            await FileIO.WriteBytesAsync(file, bytesstream);
            new ShowNotif(file, videoname, imageuri); 
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants