HttpHandlers / Modules :: WAV Stream To File?
Mar 16, 2010I have a url that points directly to a wav file. Id like to extract the file from the url and save it to a file on our file system.
View 2 RepliesI have a url that points directly to a wav file. Id like to extract the file from the url and save it to a file on our file system.
View 2 RepliesI have an httpmodule and it has a handler for OnEndRequest. I am trying to write the HttpContext.Response.OutputStream to a file. I am trying to use the Read method of it. But when it is called the exception message i get is "Specified method is not supported". So i am not able to do what i want that is, write the response to a file on the disk. I am able to write the HttpContext.Request.InputStream to a file using its Read method which i do in a handler for OnBeginRequest.
View 2 RepliesI have this httpHandler that reads a varbinary(MAX) field from the database and stream it as an FLV video. Now, how do I implement sequential access in this handler? I need it to read bytes in chunks and stream it.I call the id of the video that is to be played, e.g ViewFilm.ashx?id=5I know I'm supposed to add CommandBehavior.SequentialAcces in the ExecuteReader(), but the rest I can't get to work.I also read that someone had a problem with this but does it concern me?[URL]
[Code]....
i have a application which use to store video in sql databasei want to have a function which should have return type of video so that i can pass it to player in next page, for that i have retrived it as byte stream but dont know how to return it as video file.if i am going wrong then suggest me some other way.Note video are based on authentication so no way to switch to file system
View 1 RepliesOur website used to be a php website, now everything changed to .net, but the customer still want to keep the original php Request url. I want to know How to set Handler mapping on IIS7 to redirect .php file to .aspx file ? In more details, when you click handler mappings on IIS 7.0, what kind of hanlder should you add (add managed handler or add script map or add wild card script map or add module mapping) to redirect .php file to .aspx file?
View 1 RepliesI have a Gridview,on that first column is a Link Button and HiddenField. I bind the Filepath to both controls. my question is
1.How to find the selected row HiddenField data(path).
2. To print that selected File using Javascript.
How to do this?
I am having a specific requirement of which I am not sure it is even possible to do but I have read somewhere in the past few days that similar to what I am trying to achieve shoud be done by writing a custom HttpHandler (or module?). Basically, I currently have a simple aspx page that accepts a file upload and forwards it to another URL (after doing some checking). The way this currently works is that my Page_Loaded gets called only after the entire file is uploaded.
What I am looking to achieve is get a hold of an uploaded file Stream early on as soon as request headers are processed so I could do some sort of piping froim the uploaded file Stream to my destination Stream. With large files this should be extra beneficial because there is no waiting time for the large file to get uploaded and my gut feeling tells me this way the memory footprint should also be lower. What I need is a forward-only Stream. No seeking needed. Therefore, I don't need to manage the entire uploaded file at some point in time. I just want to send the bytes as soon as they are received (with some lightweight processing in between).
I have the below code which does not work. I cannot instantiate my class this way.
SecurePage secureCs = new SecurePage();
I want to be able to inherit the class instead of instantiating.
[Code]....
i have generic handler file ashx file , i want to pass value from my codebehind to ashx file and i want to use switch case inside the ashx handle
View 1 RepliesHere is my problem, I've created a button image, by clicking on it, it should popup a window to save as the document. This is working fine, my only point is : it showing the name of the page instead of the file. But when i download it, I've the right file.
This is my code:
[Code]....
And the code behind:
[Code]....
.ashx file is working perfectly in visual studio iis but when hosted it is not working
View 2 RepliesI have implemented URL rewritting in my application. I did it in Application_BeginRequest located in Global.asax. My url rewritting in working fine. Now in order to maintain rewritting during post back.
I have added code line this.Form.Action = Request.RawUrl; in page load event in order to maintain rewritten URL during post back. When I am adding below code on image button click to download file it doesn't work. It says "Internet explorer cannot display webpage". When I am removing line this.Form.Action = Request.RawUrl; from page load then downloading file will start working but URL rewritting will not work on postback.
FileInfo objFi = new FileInfo(Server.MapPath(filepath));
this.Form.Action = Request.RawUrl;
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + objFi.Name);
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.AddHeader("Content-Length", objFi.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.WriteFile(objFi.FullName);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
Due to some strange things I need to write an http module that sends a status code 200 whenever it recieves a request for an .ics file. I tried to do this in the begin request setion of the http module but that doesnt seem to be soon enough.
View 1 Repliesi have a custom handler which captures user's book mark entry. To debug this handler, i have created a file "test1.txt" in code behind which saves the user entry. After the debug, i removed the text file (test1.txt) then re-complied the web app and deployed new DLLs for the site. But, the site is still looking for test1.txt file. i dont know how to confirm if the handler is really removed from the new DLL. Also, looked at the handler code behind file and didn't find any entry with test1.txt. So,
View 1 Repliesi am doing a page to sell files online
the paying method is by a card or bank account and the customer is not registered to the site so i want to make sure that the customer has downloaded the file successfully after that the system completes the payment operation.
i have doubt i have a .ashx file is in project called ShowImage.ashx,Currentely i am using this file for to show to show images in uploading area used to immediately show image after uploading it to the uploader on the web page
here some part of my code
event on UPLOAD BUTTON CLICK
HttpPostedFile File = FileUpload1.PostedFile;
.....
............
Image1.ImageUrl = "~/ShowImage.ashx?id=" + id;
but now i want to pass the user id containg textbox value to this .ashx file(it is an int Value not string) how can ito send my textbox int values to .ashx file and receive the result
i manage the doc extension through a customized HttpHandler :
I set <add verb="GET" path="*/*.doc" type="MOMA.IWT.Framework.Portal.Components.HttpHandler.ResourcesHandler, PortalComponents" /> in the httpHandlers section of the web.config file and in IIS property i add a mapping for .doc with C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll
So, when i try to get a file named like pippo.doc within my web application [URL) my handler intercept the request, all right but when i try to get [URL]the result is 400 bad request My question are: why the handler doesn't intercept the request? How can I open the pippo..doc document?
I'm downloading a binary file from a SQL database to a client machine and want to instead download it to a folder on a server. THe code I'm using is below. How would I change the .AddHeader(I assume) to send the file to a folder on my server rather than the computer running the web page.Protected Sub download(ByVal dt As DataTable)
View 3 RepliesI have read in many places that referencing IRequiresSessionState or IReadOnlySessionState will allow me access to the Session scoped variables from within the ProcessRequest method in an ASHX file.
I have implemented these changes, as follows, and I am unable to retrieve this data still, as the server returns a null object reference error:
using System;
using System.Web;
using System.Web.SessionState;[code]....
The error is most certainly specific to pulling data from the session, yet I am 100% certain that the session contains data in this key.
It shouldnt matter where I am storing the data (cookies, vs db, etc), right?
This seems as good a place as any for this question. It has to do with an .ASHX handler.
I have written a generic file serving handler in asp.net/vb.net - it has been working great. I recently moved to a windows 7 box and am now debugging under IIS7, and this is where the problems occure.
Whenever I serve a file to either FireFox or Chrome (IE8 works fine) from IIS 7, the download will fail.
- In FireFox the error is "[some file name and path].part could not be saved, because the source file could not be read."
- In Chrome the error is "Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error."
- In IE8 it works fine
If I run the same code in IIS6, it works fine. If I run the same code in the Visual Studio virtual web server, it works fine (on windows 7 or XP).
I am rather concerned about this as our production web server will soon be IIS7; which I'm starting to really love, and would hate to revert to IIS6 just because this won't work in IIS7.
Here is the code I'm using..I've tried a number of different patterns. It seems to always fail on the Flush() line with the error "System.Web.HttpException = {"The remote host closed the connection. The error code is 0x80070040."}"
One thing I have noticed, if I move the flush statment to the finally clause or remove it all together; firefox will attempt to read the entire file - it appears to be looping through the entire block of code just fine, until it hits the flush statement. If I remove the flush statment I still get an error and it still tries to read the entire file before asking me to save it.
--Edit: I removed the flush and tested again; firfox thinks it downloaded a zero byte file.
I'm assuming I just have some sort of header issue going on here, but I'm at a loss at this point as to what that would be.
[Code]....
After adding a custom module, Module list is showing MyModule "Entry Type" as "Local".
and Entry Type of all other modules is "Inherited".
what is Entry Type and difference between "Local" and "Inherited"?
is httpmodules executed each and every time in request and response cycle ?? if Yes is it possible to disable a specific http module ??
View 3 RepliesI'm about to submit my pad file to multiple sharware sites but the pad file has to have a direct link to the download file and can't link to a download page which is what I would like to do, so I can track the traffic and get the downloader's email before allowing the download. I am running an ASP.NET site in VB. Is there a way to tell the web app to redirect to a specific aspx page when it receives a request for a specific file?
View 1 RepliesI am in a situation where i need to design a mechanism where i want my server to access files from a file server. There's gonna be another desktop application who will be talking to this file server.
View 8 RepliesI have an excel file in my Response Output stream. I can Open the stream as a file after a prompt, but it doesn't seem I can save it directly to a specified folder on my client.
View 1 Replies