1

While there is no issue in downloading a file from an normal url, there is an issue i am getting when passed a blob url to download the file. The file is able to download but with empty content.

Below is my code:

WebClient downloader = new WebClient();
var task = downloader.DownloadFileTaskAsync(new Uri("https://normal-url"), @Filepath);

This is downloading file with content. But when i use a blob URL as below, the empty content file gets downloaded.

WebClient downloader = new WebClient();
    var task = downloader.DownloadFileTaskAsync(new Uri("blob:http://localhost/384566b5-1a50-4c39-89e9-94e2214cbc97"), @Filepath);

The blob url is passed from javascript through web service.

  • It doesn't look like correct JavaScript, because EcmaScript has no type declarations like `WebClient downloader`. And what is this `@Filepath` starting with a `@`? You should tell us what is this language to get relevant answers. – ilyaigpetrov Mar 20 '17 at 11:30
  • @ilyaigpetrov it looks more like C#. I suggest removing `blob:` from the URI string. – jorgonor Mar 20 '17 at 11:38
  • yes, it is c# code. and removing blob: also not worked. @ilyaigpetrov – Sunil K Behera Mar 20 '17 at 12:12
  • I need the solution too. It looks strange that browsers can show the content from this url, but c# can't download it in a simple way. – ihavenokia Dec 19 '17 at 10:40

0 Answers0