c# - DownloadFileAsync shows as completed but no file exists in specified directory -
i using:
webclient client = new webclient(); client.downloadprogresschanged += new downloadprogresschangedeventhandler(client_downloadprogresschanged); client.downloadfilecompleted += new system.componentmodel.asynccompletedeventhandler(client_downloadfilecompleted); client.downloadfileasync(new uri(selected.url), fh.tempfolder);
to download file url know works. fh.tempfolder
c:\users\<username>\appdata\local\temp\filestoretemp
, have updated manifest elevate application highest available user level, yet file not download location.
the downloadfilecompleted
event fires, when debug , step through, appears though download goes start completed, shouldnt happen file few hundred mb in size, , time needed download it.
i have tried changing download location desktop , still same thing.
you must specify folder , file name destination in method downloadfileasync
. msdn link
webclient client = new webclient(); string tempfolder = @"c:\temp\"; client.downloadfileasync("test.com\test.txt",tempfolder); // won't work client.downloadfileasync("test.com\test.txt",tempfolder + "test.txt"); // works
Comments
Post a Comment