question

rajusomala-6534 avatar image
0 Votes"
rajusomala-6534 asked RoyLi-MSFT edited

Background Downloader with FTP not working.

HI Team ,

I have set up an FTP server by using IIS(Windows 10 and IIS Version 10.0.19041.1).

Client uwp application uses BackGroundDownloader API to download files from FTP server. The FTP server directory consist of different files.
Filenames are in English , some are in Japanese.(こんにちは.JPG, カメラ.PDF , File1.PDF ectc..)

Files that have English names are downloading properly. and Japanese FIle names are not downloading.

Download operation class has URI as a parameter. The below is string URL I am using for Japanese

ftp://admin:admin@xxx.yyy.z.z/Folder1/Folder2/%E3%81%8A%E5%BD%B9%E7%AB%8B%E3%81%A1%E6%83%85%E5%A0%B1%E6%8A%95%E7%A8%BF%E3%82%A2%E3%83%BC%E3%82%AB%E3%82%A4%E3%83%960707-2.jpg

when I try the same with HTTP it is working fine

http://xxx.yyy.z.z/Folder1/Folder2/%E3%81%8A%E5%BD%B9%E7%AB%8B%E3%81%A1%E6%83%85%E5%A0%B1%E6%8A%95%E7%A8%BF%E3%82%A2%E3%83%BC%E3%82%AB%E3%82%A4%E3%83%960707-1.jpg

Background Transfer Sample UWP application will crash when I am using FTP URL. working fine with FTP URL

windows-uwp
· 13
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@rajusomala-6534 Could you please tell me what method you use to escape the Uri string? EscapeUriString or EscapeDataString ?

0 Votes 0 ·

Hi,

Thanks for your reply. We are using EscapeDatastring. After your comment, I used EscapeUriString to verify but no change in behavior.


string escapeString = Uri.EscapeUriString("お役立ち情報投稿アーカイブ0707 - 2.jpg");
sstring url = "ftp://admin:admin@XXX.XXX.XXX.XXX/Folder1/Folder 2/" + escapeString;
if (!Uri.TryCreate(url.Trim(), UriKind.Absolute, out baseUri))
{
//rootPage.NotifyUser("Invalid URI.", NotifyType.ErrorMessage);
return;
}

The output of Uri.TryCreate baseUri is used to pass DownloadOperation Parameter.






0 Votes 0 ·

@rajusomala-6534 You could try to encode the original string to ASCII bytes first, and then encode it back to UTF8. As follows: Uri.EscapeUriString(Encoding.UTF8.GetString(Encoding.ASCII.GetBytes(filename)));.

0 Votes 0 ·
Show more comments

0 Answers