1

I am creating a downloader application. My codes work very well but i have a problem as bellow:

  • I put a file in a place on the host by FTP. It can be accessible by a link like this:

example.com/box/music.mp3

  • First, i run my downloader and it try to download the music.mp3 and it can do it completely.

  • Now, i rename the music.mp3 to music11111.mp3 on the host by a FTP application.

  • Then, i run my downloader again and it try to download the music.mp3 and it can!!!

Why my downloader can download the removed or renamed file on the host???

I can download it by firefox even!

I used the following code in my application to prevent cache but it didn't help me.

public static class NativeMethods
{
    [DllImport("WinInet.dll", PreserveSig = true, SetLastError = true)]
    public static extern void DeleteUrlCacheEntry(string url);
}

I think this is a effect by web server, such as cache or.... is it? any idea...?

Is there a way to prevent download a cached file without any code on the web server?

If i should write some codes on the host please guide me by a link or instruction, my host is a Windows Server and it use IIS and my Website has been written by ASP.NET MVC.

Community
  • 1
  • 1
Ramin Bateni
  • 16,499
  • 9
  • 69
  • 98

0 Answers0