4

On my website, I play music using HTML5 audio.

The issue I have is, if the music is currently playing, I can't publish via FTP.

When I publish, in visual studio, I check the option to delete all the files first.

I understand why the publish fails. The file is in use (it's streaming) and it can't delete it!

I appreciate this isn't a coding issue per-se, but, it's relevant to me as a developer and I suspect other devs.

The issue I have is I can't publish unless no one is streaming media at the time I try to publish. This is an insane position to be in.

My question is how do I publish my site?

MyDaftQuestions
  • 4,487
  • 17
  • 63
  • 120

1 Answers1

1

You can use app.offline file in your root folder

If you are running your application within a .NET 4.0 application pool (IIS 7.0 or IIS 7.5) or your web site is configured as an ASP.NET 4.0 web site (IIS 6.0) and would like to show your clients an “under maintenance” page for a limited time, the easiest way is to put a file named app_offline.htm in your web site’s root folder. Then your application will be taking offline and the clients will be served with app_offline.htm page whatever their requests are.

When you are done with maintenance, just remove or rename the file and everything goes back to normal.

reference 1

reference 2

reference 3

Community
  • 1
  • 1
Santhosh Nayak
  • 2,312
  • 3
  • 35
  • 65
  • I've given the bounty but I get the feeling this is the only way to fix it. It's not a good solution though as there is nothing stopping the user perpetually looping the streamed file. I guess my other option is to not delete the existing files first... – MyDaftQuestions Sep 19 '16 at 09:10
  • Yes while publishing you need not to delete all files. :) – Santhosh Nayak Sep 19 '16 at 10:22