Add A Handler To Allow Dowloading Script Or A MIME Map?
Jan 25, 2011
I created a script for Internet Explorer which can be installed using GM4IE (Greasemonkey for Internet Explorer) and it has the extension .gm4ie.
When I try to give the download link to this file on my server, it gives this error:
http://i.imgur.com/K7Rs4.jpg
page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
How do I add this this hanlder or a mime map and where do I add this?
I created a script for Internet Explorer which can be installed using GM4IE (Greasemonkey for Internet Explorer) and it has the extension .gm4ie.
When I try to give the download link to this file on my server, it gives this error: [URL]
page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
How do I add this this handler or a mime map and where do I add this?
What is the code to dowloading a copy of a file from server? For example to access some webpage using different font like chines ,Hidi etc.they will provide a option to download the corresponding font for read the site.
As I understand it, in IIS7 if I can get to it I should see both custom additions in my web.config as well as the mime types defined in the IIS manager at the machine level.
I don't understand how to get to this data. I have messed with the configurationmanager but I am not getting anywhere. I can get a section names system.webServer but I don't see any of the actual data as colleciton of properties or as xml.
When inserting a binary file do you know what will be the correct content type for extensions like .txt or .gif or others not in your sample? Is there a list of correct content types?
I want to add mime type in web.config to make downloading files for users.but after adding mime tag, website starts showing internal error 500 and removing this, it runs fine but when user click on files to download then it show error that file not found. So I need to add proper mimetype for my uploaded files. So pls tell me the proper way to add it to web.config file.
I create custom HTTP handler for auto generating file and I want to tell IIS7 to serve current request like normal static file because I need to use IIS and web.config file to control compression setting and any other HTTP header of current requested file.I know. there is an internal class called StaticFileHandler in ASP.net. But I cannot access it. Or you have any other way to work like this.
Is there a technical reason for the existence of Page.PreLoad or is this just convenience to have a place where you can neatly place code that always have to be executed before the Load code? Is there a difference between adding code in the PreLoad event handler and adding code at the top of the Load event handler? And what would be a typical scenario where you use PreLoad?
In Visual Studio 2010, when you say new Item, you can see Asp.NET Handler and Generic Handler. Can you tell me what's the difference, I think it came with .NET 4.0 because I couldn't find related thins on Google.
I need to update the handler mappings on IIS 7.5 to allow URLs that don't have extensions to be routed to an application. The application was originally written in ASP.NET 2.0, but then later upgraded to ASP.NET 3.5. I don't know if that has relevance, but I've had no problem updating handler mappings for other .net 3.5 apps before. I should also note that this works fine on IIS 6.0
This is the error message I get when I click the Handler Mappings link in IIS 7.5 (notice there isn't really an error message as such, which would be helpful):
Handler Mappings
There was an error while performing this operation.
Details: Filename: ?D:path oweb.config Error:
OK
Has anyone seen this before? If you need more info, let me know and I'll supply.
I'm trying to write an HTTP GET handler. The path should start with http://site/processTask and have a set of URL-encoded parameters. I have the following in my web.config
now when I type the URL http://mysite/processTask in browser I get HTTP 404 but if I change the add verb line to the following one:
<add verb="GET" path="processTask.asmx*" type="MyHandler.ProcessTaskHandler, MyHandler"/> and type http://mysite/ProcessTask.asmx in browser the handler is run and I get the response from the handler. What's the problem? Why is the handler run only when the path contains .asmx? How do I change web.config so that .asmx is not required?
I've got a simple ASHX handler that returns an dynamically generated image; the image is generated from a custom created class, and an object belonging to this class is passed to the handler using Session (I'd rather avoid using QueryString).The handler is used as the URL of an image on a ASP form which is very simple: a drop down list, a button and an image. Basically, depending on what the user selects from the list, the appropriate image will be generated once the button is pressed.
At the start the actual image has it's Visible property set to false; I don't want the handler to display anything before the data is all there.Once the button is pressed, the required Session parameter is added containing the necessary object, and the page is refreshed using Server.Transfer. When the Page_load method detects that the Session parameter has been correctly set, it sets the Visible parameter on the image to true.After that the handler fires up and generates the image.
So far so good... However, if the user now picks something different from the list and presses the button, despite the correct object being passed in the Session, the image won't be updated. In fact, the handler won't even fire up (if I put a breakpoint in there). I need to close the browser window and reopen it for it to work.Any ideas what could be the cause of such behaviour?I suspect the answer is very simple, and I just don't know something fundamental about ASP (or handlers)...
I am using ASP.NET Callbacks (that implements the ICallbackEventHandler) and in the handler, I try to set a value of the text box:
txtName.text = "Test";
but this value is not set. Is this a limitation with callback? It appears I cannot do much in a callback handler other than sending back a string to the client side (ofcourse I can access the Session etc)
I've created a class library project and this has a class implementing the IHttpHandler interface. Let's call this class ZipHandler. Let's say the namespace is Zip. I want that whenever any Http request comes for a zip file, my ZipHandler should handle it, regardless of whether the request is to an Asp.Net application or a normal virtual directory.
Queries:
Is it possible (it should be given the hype about integrated pipeline etc. in IIS 7)? How to do it?
The code below is a handler to allow variables in css files. Works fine except when, as shown, I need to retrieve a value from the mvc route. In the code below the variable "Forum" is a route value.
What code do I need in this handler to retrieve the route value of Forum?
I've created a database table with a bunch of links I'm going to use in my program. All seems fine, except for the onClick even handler, which doesn't work as a string. Anyone got an idea how I can set it? There's no constructor for EventHandler accepting a string...
i write a html code for file saveas using file uploading control. here file saveas working for aspx code but not working for html code to call handler(ashx).