I download a file from FTP by pressing a button to a folder on the phone. How to specify this folder?
button.Click += delegate { string inputfilepath = @"/storage/emulated/0/Download/1.txt"; //путь к папке на телефоне string ftpfullpath = "ftp://ххх/ххх/1.txt"; using (WebClient request = new WebClient()) { request.Credentials = new NetworkCredential("login", "password"); byte[] fileData = request.DownloadData(ftpfullpath); using (FileStream file = File.Create(inputfilepath)) //здесь выдает исключение Access to the path "/storage/emulated/0/Download/1.txt" is denied { file.Write(fileData, 0, fileData.Length); file.Close(); } } };
READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE), do you have them (judging by Access denied not ...)? - EvgeniyZ 4:27 pm