locked
How to prevent file caching when downloading file by BackgroundDownloader?

    Question

  • Hi! I am using BackgroundDownloader for download files from remote ftp server.

    StorageFolder ^appLocFolder = ApplicationData::Current->LocalFolder;
    
    Platform::String ^tStr = appLocFolder->Path;
    
    task <StorageFile ^> (appLocFolder->CreateFileAsync (fileName, CreationCollisionOption::ReplaceExisting)).then ([this] (StorageFile ^destinationFile)
    {
    	BackgroundDownloader ^downloader = ref new BackgroundDownloader ();
    			
    	DownloadOperation ^download = downloader->CreateDownload (source, destinationFile);
    
    	download->StartAsync ();
    });

    But it really downloads file directly from server only once. Then the file downloads from cache. How to prevent/disable this behavior?

    I want to download file directly from ftp server each time when I call StartDownload.

    Monday, December 3, 2012 2:01 PM

All replies

  •  up 
    Tuesday, December 4, 2012 12:02 PM
  • Dont have the nice solution, but was workaround maybe put a random parameter on the query string ?


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, December 4, 2012 1:03 PM
  • Sorry, I didn't understand your reply. Can you explain what did you mean?
    Tuesday, December 4, 2012 1:36 PM
  • if you got the following url http://mywebpage.com/filetodownload.zip you can (mostly) also use tp://mywebpage.com/filetodownload.zip?t=320872

    where the value for t is a random number. So you can bypass the cache


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, December 4, 2012 1:41 PM
  • But I have an ftp request. Like this one "ftp://Polimorfic:klub05468@178.219.84.132/file_to_download.xml".
    Tuesday, December 4, 2012 1:55 PM