Re: workaround for FCN/directory delete bug

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Good point.

In my particular case, it was more a library of misc documents so I served
anyway all files using an attachment disposition for consistency.

Plus I always use myself "save as" on third party site as I really dislike
this feature that makes generally the browser (at least IE) much less
responsive IMHO ;-)

It looks this is discussed here and there :
http://www.google.com/search?hl=en&q=pdf++download+aspnet+handler+accept+range

Interesting topic.

---
Patrice

"Andy Fish" <ajfish@xxxxxxxxxxxxxxxx> a écrit dans le message de news:
eeiAEaI9HHA.1188@xxxxxxxxxxxxxxxxxxxxxxx
for the most part that is exactly what I am doing

however, to serve optimized (linearized) pdfs properly is rather more
complicated because the browser requests chunks of the file with separate
HTTP requests, so for this case I decided the best solution was to make a
temporary copy of the PDF underneath the web root, then redirect the
browser to it. that way the optimized download works properly without lots
of extra code

Andy

"Patrice" <http://www.chez.com/scribe/> wrote in message
news:eT6BO%2378HHA.5164@xxxxxxxxxxxxxxxxxxxxxxx
My personal preference is just to not store those files under my web site
structure :
- you can server files stored outside of your structure (using an ASPX
page or a handler that allows additionaly to control how it is accessed
especially if those files are not supposed to be served to everyone)
- you could also likely use a virtual folder

This keep your web application and its data apart...

--
Patrice

"Andy Fish" <ajfish@xxxxxxxxxxxxxxxx> a écrit dans le message de news:
eU15X278HHA.484@xxxxxxxxxxxxxxxxxxxxxxx
just found this:

https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=240686

and I have implemented Kritter's hack which works fine for me on XP and
win 2003 - copied below FYI:

Entered by [By]Kritter on 23/07/2007

A dirty hack that works:
PropertyInfo p =
typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor",
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
object o = p.GetValue(null, null);
FieldInfo f = o.GetType().GetField("_dirMonSubdirs",
BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.IgnoreCase);
object monitor = f.GetValue(o);
MethodInfo m = monitor.GetType().GetMethod("StopMonitoring",
BindingFlags.Instance | BindingFlags.NonPublic);
m.Invoke(monitor, new object[] { });

This code will turn off monitoring from the root website directory, but
monitoring of Bin, App_Themes and other folders will still be
operational, so updated DLLs will still auto deploy.




"Andy Fish" <ajfish@xxxxxxxxxxxxxxxx> wrote in message
news:%23O$jCO66HHA.5796@xxxxxxxxxxxxxxxxxxxxxxx
Thanks Bruce,

From what I can see, files in the app_data folder are not served
through IIS. Files in the folder structure I am creating need to be
visible to the web browser, so that solution is no good for me.

Andy

"bruce barker" <nospam@xxxxxxxxxx> wrote in message
news:uJojDf16HHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
create an app_data folder in your site, which asp.net does not
monitor.

-- bruce (sqlwork.com)


Andy Fish wrote:
hi,

I have come across the problem mentioned in this blog

http://blogs.msdn.com/toddca/archive/2005/12/01/499144.aspx

it's basically the fact that in ASP.NET 2.0, the File Change
Notification is uses causes the application to unload every time a
directory underneath the webroot is deleted.

The bodge suggested as a work-around in the article (which involves
messing around with the file system) is not an option that is open to
me.

Does anyone know whether a proper fix or workaround for this problem
is available? if not, the only thing I can think of is to delete only
files at runtime and then wait until application shutdown to clear
the directory tree.

Regards,

Andy










.



Relevant Pages

  • Re: workaround for FCN/directory delete bug
    ... complicated because the browser requests chunks of the file with separate ... temporary copy of the PDF underneath the web root, then redirect the browser ... PropertyInfo p = ... files in the app_data folder are not served through ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IE launching when Firefox is default browser
    ... default browser settings. ... misunderstand the location of the Links toolbar. ... When you said "Then reopened Ff, went to the Links folder on my ... the browser or Explorer. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE launching when Firefox is default browser
    ... reasons which evade me) is the process that launches the browser under the ... as I find the desktop toolbar quite handy for accessing ... When you said "Then reopened Ff, went to the Links folder on my ... the browser or Explorer. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE launching when Firefox is default browser
    ... After making FireFox my default ... went to the Links folder on my ... default browser via the Control Panel>Add/Remove Programs>Set Program Access ... Replies are posted only to the newsgroup for the benefit or other readers. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE launching when Firefox is default browser
    ... If you select shortcuts via Windows Explorer then ... default browser settings. ... a new folder in the Links folder and copied a couple of links into it. ... set up a desktop toolbar that points direct to it. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)