SSL In HttpContext.Current.Response / Transmission File Protected By SSL?
Sep 21, 2010
In ASP.NET, if a file was downloaded on a page that was protected by SSL, through a server-side postback that writes to HttpContext.Current.Response.OutputStream, is the transmission that file ALSO protected by SSL?
View 1 Replies
Similar Messages:
Dec 17, 2010
I'm trying to create a ZIP file on the fly which might contain a few thousands of pictures.
[code]....
My question:
Is there a way to initiate the download (let the download manager on client side popup), and then start writing on the stream?
I monitored w3wp.exe (IIS) process, and it seems that the data is being written on memory instead of Stream.
When w3wp.exe memory usage riches a certain number, it releases the memory and nothing happens (no download).
View 2 Replies
Mar 23, 2011
As I have migrated Web Application from 3.5 (VS 2008 ) to 4.0 Vs (2010)
Now i am having problem with Response.Redirect
As I in .aspx pages i have found the following solution and it is working fine.
old Code with is not Working in Vs2010
[code]....
But now I need to Redirect from the class librarySo can any one guide me on the same.. i can i redirect .. AS I have try with HttpContext.Current.Response.Redirect(strURL); but it is not working.
View 1 Replies
Feb 25, 2010
Does anyone know how to use httpcontext.response.transmitfile or any other httpcontext function to download a file from a network drive instead of local drive? When I tried to use context.Response.TransmitFile(DownloadPath) to download files, the DownloadPath has to be local drive. If it's a network drive, the download failed.
View 2 Replies
May 20, 2010
1. SetSession.aspx page sets value for a session variable and redirects to default.aspx page using Response.redirect() code.
2. Default.aspx page tries to create an object of class in app_codecommon.cs file.
3. In app_codeCommon.cs file, I am trying to access the session variable set in step1 using HttpContext.Current.Session object.
but step 3 gives error that object reference not set to an instance. as HttpContext.Current.Session is null.
I surf abt it on net, and seems to be problem with asp.net framework.
View 1 Replies
Feb 25, 2010
Does anyone know how to use httpcontext.response.transmitfile or any other httpcontext function to download a file from a network drive instead of local drive?
When I tried to use context.Response.TransmitFile(DownloadPath) to download files, the DownloadPath has to be local drive. If it's a network drive, the download failed.
View 3 Replies
Apr 22, 2010
i have to implement GEDCOM export in my site. my .net code created one file at server when export to gedcom clicked. then i need to download it to client from server as well as user should be asked to where to save that file means savedialog is required. after its downloaded. i want to delete that file from server.
i got one code to transmit file from server to client
Response.ContentType = "text/xml";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + FileName);
Response.TransmitFile(Server.MapPath("~/" + FileName));
Response.End();
but i am not able to delete the file after this code as Response.End ends response so whtever code written after that line is not execute.
if i do code to delete file before Response.End(); then file does not transmitted and got error.
View 2 Replies
Mar 11, 2010
I have a static class with serveral static methods. In these methods, I'm trying to access the current thread's context using HttpContext.Current. For example:
var userName = HttpContext.Current.User.Identity.Name;
However, when I do that, I receive a NullReferenceException, the infamous "Object reference not set to an instance of an object."
View 3 Replies
Nov 23, 2010
I have been experimenting with code that will clear all of the cookies in an HttpContext.Response.Initially, I used this:
DateTime cookieExpires = DateTime.Now.AddDays(-1);
for (int i = 0; i < HttpContext.Request.Cookies.Count; i++)
{
HttpContext.Response.Cookies.Add(
new HttpCookie(HttpContext.Request.Cookies[i].Name, null) { Expires = cookieExpires });
}
this will error with an OutOfMemoryException because the for loop never exits - each time you add a cookie to the Response, it also gets added to the `Request.
View 1 Replies
Nov 23, 2010
i'm using an example in which i can fake the session.It's for use in a unittest of a mvc controller.In the test i create a controller and then i do this:
FakeHttpContext httpctx = new FakeHttpContext(null,null,null,null,mSessionItems );
ControllerContext ctx2 = new ControllerContext(httpctx,new RouteData(), target);
here mSessionItems is my session and target is my instance of a controller,and indeed, when i'm in a controller reading this.ControllerContext.HttpContext.Session, i have a session, great!but.... i also read the session outside the controller, and there i use HttpContext.Current.Session, and that is null (or actualy, the HttpContext.Current is null).
View 1 Replies
Apr 6, 2010
I am trying to open a PDF file that is protected. Is there a way using Response.AddHeader to define the password without having to prompt the user? Adobe automatically prompts the user to enter in the password. I do not want this to occur.
The following is how the pdf file is served to the user:
[Code]....
The file is protected as it may contain private information and we do not want to the user to freely download the file using Adobe reader without having the pdf protected. Is there a way to pass the password to the browser without prompting the user (through Adobe)?
View 3 Replies
May 20, 2010
What is httpContext.Response.SubStatusCode for? this value is part of the IIS integration mode pipeline.
View 2 Replies
Aug 5, 2010
I'm wondering how HttpContext.Current gets assigned a unique instance for every request considering it's a static object?
View 2 Replies
Feb 21, 2011
I have question about HttpContext class (http://msdn.microsoft.com/en-us/library/system.web.httpcontext.aspx). This class has Responseproperty (http://msdn.microsoft.com/en-us/library/system.web.httpcontext.response.aspx). But I don't understand, why Response property hasHttpResponse return value, not HttpContext (this is HttpContext, not HttpResponse property).So, why there is:
[Code]....
not
[Code]....
View 3 Replies
Feb 5, 2010
Is it safe to always assume that HttpContext.Current will be non-null in Application_PreRequestHandlerExecute?
EDIT: Assuming ASP.NET webforms (not MVC).
View 2 Replies
May 4, 2010
As per title. I want to be able to save some data in a cache object but this object must be available to all users/sessions and can expire.What is the best method to achieve this in a asp.net web app?
View 2 Replies
Aug 20, 2010
I am getting HttpContext.Current.Session is null.Will this be a problem if we have application hosted in web farm.
View 1 Replies
Jan 20, 2011
I have some code that works fine when I need to delete some image files from a directory on my web server:
Dim ImageURL As String = dsImages.Tables(0).Rows(iImgRow).Item("ImageURL")
Dim physicalName = Server.MapPath(ImageURL)
oUpload.DeleteFileFromServer(physicalName, iAdid, iImgID)
.but I am running into a problem when a maintenance task running in a separate thread at set intervals determines that files like the above need to be deleted:
Dim ImageURL As String = dsImage.Tables(0).Rows(i - 1).Item("ImageURL")
Dim iImgID As Integer = dsImage.Tables(0).Rows(i - 1).Item("ImageId")
Dim physicalName As String = HttpContext.Current.Server.MapPath(ImageURL)
oUpload.DeleteFileFromServer(physicalName, iAdID, iImgID)
In this latter case, HttpContext.Current.Server.MapPath(ImageURL) has a value of Nothing.Is there a way to get the full path for this case?
View 1 Replies
Feb 12, 2011
For instance if I'm inside the Page_Load method and I want to get query string data I just do this:
public partial class Product_Detail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
[code].....
View 4 Replies
Jun 7, 2010
i have problem accessing HttpContext.Current.Application From global.asax its seems to be null every time i try to access it. How can i to this?
HttpContext.Current.Application.Lock();
HttpContext.Current.Application["Actions"] = "hello";
HttpContext.Current.Application.UnLock();
View 2 Replies
Dec 15, 2010
During Application_End() in Global.aspx, HttpContext.Current is null. I still want to be able to access cache - it's in memory, so want to see if I can reference it somehow to save bits to disk.
Question - is there a way to reference cache in memory somehow when HttpContext.Current is null?
Perhaps I could create a global static variable that would store pointer to cache that I could update on HTTP requests (pseudo: "static <pointer X>" = HttpRequest.Current) and retrieve a reference to cache through that pointer in Application_End()?
Is there a better way to access Cache in memory when there is no Http Request is made?
View 3 Replies
Oct 20, 2010
am writing a web service in vb.net/asp.net 2, that needs user's name. It works fine when the url request is "www.mysite.com" but if any one has logged-in using "mysite.com" without a "www" and goes to the page that calls my web service, The HttpContext.Current.User.Identity.Name gives null. How can I resolve this problem?
View 2 Replies
Jan 15, 2010
Where does httpcontext.current.server.mappath start?
I don't get it... it doesn't return a path.
My webservice is ran when I debug my application :S.
View 4 Replies
Mar 28, 2011
Last night I wrote up my first IHttpModule to do some request processing. I'm using a regular expression to inspect the raw url. The IHttpModule will be called on every request, so it seems reasonable to do some sort of caching of the regular expression object to prevent creation of it on every request.
Now my question... what is better: use the HttpContext.Current.Cache to store the instantiated object or to use a private static Regex in my module?I'm looking forward to the reasons why. Just to clarify: the regex will never change and thus always be the same thing.
View 3 Replies
Oct 13, 2010
I wanted to understand the behavior of HttpContext.Current.Application during the load balancing. I have read that session can be stored in disk hence can be retrieved from different servers. Is this true for HttpContext.Current.Application also. Does the keydata stored in one machine is accessible in other different machine too?
View 1 Replies