Http - Debugging Strings Downloaded To Browser (Montréal Instead Of Montréal)?
Mar 28, 2010
I'm downloading a vCard to the browser using Response.Write to output .NET strings with special accented characters. Mime type is text/x-vcard and French characters are appearing wrong in Outlook, for example Montréal;Québec .NET string shows as Montréal Québec in browser.Apparently vCard default format is ASCII. .NET strings are Unicode UTF-16.I'm using this vCard generator code from CodeProject.com
I've played with the System.Encoding sample code at the bottom of this linked MSDN page to convert the unicode string into bytes and then write the ascii bytes but then I get Montr?al Qu?bec (progress but not a win). Also I've tried setting content type to both us-ascii and utf-8 of the response.If I open the downloaded vCard in Windows Notepad and save it as ANSI text (instead of default unicode format) and open in Outlook it's okay. So my assumption is I need to cause download of ANSI charset but am unsure if I'm doing it wrong or have a misunderstanding of where to start.Update: Looking at the raw HTTP, it appears my French characters are being downloaded in the unexpected format so it looks like I need to do some work on the server side... (full size)
View 2 Replies
Similar Messages:
Feb 21, 2011
I have an ASP.NET web application that has HTTP compression enabled (through IIS settings). One of the features of the app involves creating multiple text files and packaging them as a single zip file to be downloaded by the user.
With HTTP compression enabled, the files created by the application are zipped twice - once by the web application and once more by HTTP compression; with the result that when the user downloads the zip file, it has 1 file which is the application generated zip file, and this second zip file has the original contents.
My requirement is to disable HTTP compression only for the zip file. How do I achieve this? The file extension "zip" is not included in the metabase file for compression.
View 2 Replies
Dec 12, 2010
I am curious as to how the file sharing sites like rapidshare detect users downloading files through download managers.
How do you enable an ASP.NET web application to prevent downloads from a download manager.
View 5 Replies
Dec 22, 2010
I have IE V 6 and firefox V 3.6 installed on my computer, when I debug my website with asp.net by Visual studio 2008 it shows my page in IE V 6,I want to debug my site with firefox, because VB 2008 shows me this MSGhttp://www.mediafire.com/i/?i0r5b7mi260wcb3
View 3 Replies
Jul 11, 2010
I.E. is not my default browser (Google Chrome is). However I would like to use I.E. as my browser when debugging from within VS2010. How do I tell VS2010 to use I.E. as the session debug browser without setting I.E. as my default browser?
View 1 Replies
Jan 5, 2011
I have two very similar pieces of ASP.NET code that send a file in an HTTP Reponse to the client. They should cause the browser to prompt to save the file. The first one works, the second one doesn't. The HTTP responses as seen in Fiddler are below.
Working:
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 228108
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 4.0.30319
content-disposition: attachment; filename=Report.xlsx
Date: Wed, 05 Jan 2011 12:17:48 GMT
<binary data>
Not working:
HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Wed, 05 Jan 2011 12:19:21 GMT
X-AspNet-Version: 4.0.30319
Content-Length: 228080
content-disposition: attachment; filename=report 2.xlsx
Cache-Control: private
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Connection: Close
<binary data>
When the first one is seen in Fiddler the browser correctly prompts to save the file. When the second one is seen in Fiddler, nothing observable happens in the browser. Same behaviour in both chrome and firefox.
EDIT: ASP.NET code that produces the second response
Response.Buffer = false;
Response.ContentType = @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AppendHeader("content-length", genstream.Length.ToString());
Response.AppendHeader("Content-Disposition", string.Format("attachment; filename={0}.xlsx", filename));
byte[] buffer = new byte[1024];
genstream.Position = 0;
int n;
while ((n = genstream.Read(buffer, 0, 1024) ) > 0)
{
Response.OutputStream.Write(buffer, 0, n);
}
View 4 Replies
Mar 24, 2010
To prevent duplicate requests (i.e. pressing F5 right after clicking a command button), I've setup my page base class to ignore the request if it's detected as a duplicate.
When I say 'ignore' I mean Response.End()
Now I thought I've seen this work before, where there's an issue, I just Response.End() and the users page just does nothing. I don't know the exact circumstance in which this worked, but I'm unable to repeat it now.
Now when I call Response.End(), I just get an empty browser. More specifically, I get this html.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD>
<BODY></BODY></HTML>
I setup the following test app to confirm the problem is not elsewhere in my app. Here it is:
Add the following to an aspx form
<asp:Label ID="lbl" Text="0" runat="server" /><br />
<asp:Button ID="btnAdd1" Text="Add 1" runat="server" /><br />
<asp:Button ID="btnAdd2" Text="Add 2" runat="server" /><br />
<asp:Button ID="btnAdd3" Text="Add 3" runat="server" /><br />
And here's the code behind file
using System;
namespace TestDupRequestCancellation
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
btnAdd1.Click += btnAdd1_Click;
btnAdd2.Click += btnAdd2_Click;
btnAdd3.Click += btnAdd3_Click;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
CurrentValue = 0;
else if (Int32.Parse(lbl.Text) != CurrentValue)
Response.End();
}
protected void Page_PreRender(object sender, EventArgs e)
{
lbl.Text = CurrentValue.ToString();
}
protected int CurrentValue
{
get
{
return Int32.Parse(Session["CurrentValue"].ToString());
}
set
{
Session["CurrentValue"] = value.ToString();
}
}
void btnAdd3_Click(object sender, EventArgs e)
{
CurrentValue += 3;
}
void btnAdd2_Click(object sender, EventArgs e)
{
CurrentValue += 2;
}
void btnAdd1_Click(object sender, EventArgs e)
{
CurrentValue += 1;
}
}
}
When you load the page, clicking any button does what is expected, but if you press F5 at any time after pressing one of the buttons, it will detect it as a duplicate request and call Response.End() which promptly ends the task. Which leaves the user with an empty browser.
Is there anyway to leave the user with the page as it was, so they can just click a button?
Also; please note that this code is the simplest code I could come up with to demonstrate my problem. It's not meant to demonstrate how to check for dup requests.
EDIT: Another change that will allow me to achieve the same results would be to disable all my event handlers.
View 3 Replies
Jul 23, 2010
we're facing a weird and seemingly randomly appearing problem where the browser renders the complete, raw HTTP response (to a GET request) including all headers and the compressed content as text instead of just using the contents and rendering it. This happens for whole page loads as well as postbacks as well as page loads inside an iframe; for sure in Firefox 3.6.*, not sure about IE right now.
Our service is an ASP.NET 2.0 web app running on IIS 7.5, on our test machines we regularly have Fiddler running in the background (wondering if this might be part of the problem).
This behaviour occurs very rarely but we have started seeing this problem lately during our tests.
Has anybody encountered this problem before and knows what causes it and maybe even knows what to do about it?
View 1 Replies
Feb 16, 2010
I used to be able to view the pages of my ASP.NET 3.5 website locally via the 'View in Browser' facility. However, this no longer works (for any page). All I get is a 'HTTP 404 Not Found' error message.
Where might I have screwed things up?
View 4 Replies
Jan 5, 2011
Basically I have a web site that renders HTML preview of some documents (mainly office). The resulting HTML fragment is included in the page returned by the same web site, however images are returned by HTTP handler from another site with the following links:
<img width="50" height="50" src="http://portal/Service/GetFile.asxh?id=123&inline=true">
For some reason all browsers except Chrome (e.g. IE6/7/8, Firefox, Opera, Safari) show everything just fine, however for these images Chrome shows "broken image" icon. If I choose "Open image in new tab" then the image is shown just fine.
Edit I thought I have solved this issue, but apparently with Fiddler turned on it works fine.
I had context.Response="utf-8" left in code, but removing it had no difference.
Headers:
HTTP/1.1 200 OK
Date: Wed, 05 Jan 2011 14:26:57 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
[Code]....
View 3 Replies
Jul 26, 2010
There is one page which is actually a streaming to The Axis IP camera which spits MJPEG output.It requires user to log in with the user name/password promp on browser .I am using this stream to show video directly on a web page.It shows video correctly but asks user to provide correct user name and password set for the camera,I tried to logging in to this camera on server side using HTTP requests and then I realized I authenticated server request not the browser the end user is using.
So what I want is a method server side or client side, that can allow me to log-in to camera automatically when my end-users visit this page.I am using asp.net with c# 2005
View 1 Replies
Jun 10, 2010
I'm looking at a website using Internet Explorer and Firefox. In each browser I select view source and see the website's URL in the links. These links were concatenated together using HttpContext.Current.Request.Url.Host in the code behind. However, when I use netcat or Burp Suite v1.3.03, looking at the same links I see the servername instead of the website's URL.
My question is - Why does view source in the browser display different links in the page source than what netcat or Burp Suite outputs? Is the browser rewriting stuff?
My thought to correct is to have a web.config setting which is used to create the links.
Next question - Does anyone know of a configuration change to make to IIS to return the URL instead of the server name or a .NET function that I should be calling instead to get the URL that the website is running as.
View 1 Replies
Jun 3, 2010
I get this error when I hit F5 in VS 2008. I have checked that Windows authentication is enabled on the site and it is. I can mannully attach the debugger to the IIS process and it works. What could be wrong? I have tried alot of things without success.
View 2 Replies
Mar 7, 2011
I'm trying to debug my web application on my localhost machine in Visual Studio 2010 and I keep getting this error: "unable to start debugging on web server. The Microsoft Visual Studio remote debugging monitor(MSVSMON.exe) does not appear to be running on the remote computer."
Is there a way I can turn this off as I'm not trying to make any attempts debugging remotely.
View 1 Replies
Jan 11, 2011
I am running Visual Studio 2010 (as Admin), IIS 7 on Windows 7 x64. I am able to run the ASP.NET web site in IIS 7 without debugging just fine, but when I press F5 to debug it, I get: Unable to start debugging on the web server. Could not start ASP.NET debugging. More information may be available by starting the project without debugging. Unfortunately the help link is not helping me much and leads down a heck of a large tree of things. I checked the following:
Security requirements — I don't recall having to do anything special before. The worker process in IIS7 is w3wp.exe. It says that if it's running as ASPNET or NETWORK SERVICE I must have Administrator privileges to debug it. How do I find out if I need to change something here? Web site Property Pages > Start Options > Debuggers > ASP.NET is checked. Use custom server is set to the URL of the site (which works fine without debugging). Debugging is enabled in web.config. Application is using ASP.NET 3.5 (I want to move to 4.0 eventually but I have some migration to deal with). Application pool: Classing .NET AppPool (also tried DefaultAppPool). Surely it shouldn't be that hard to install IIS, VS, create a web site, and start testing it?
View 2 Replies
Nov 16, 2010
Does anyone know if it is possible to measure when a file has been downloaded?
I place files for clients to download but there are two things I need to know. One is if the file has been downloaded at all at any point. Second is how many times the file has been downloaded. Can each file (usually but not always image files - sometimes pdfs) be tagged in some way to record what happens to it?
View 2 Replies
Oct 12, 2011
I am building an excel file using the OpenXml sdk 2.0. I am putting it in a memory stream and outputting it to the browser.The problem I am receiving is wiht IE 9 if I click Open it says "filename couldn't be downloaded". If I hit save/save as and save it to the filesystem, then open it, the file opens fine with no errors.
In Firefox regardless of if I use save or open the file when opened in excel says its corrupt.I already built the file by writing it to the filesystem first and that code works. Also since saving to desktop in IE lets me open the file, im assuming the problem has to be with the settings on the Response.BinaryWrite.
I have tried changing the buffer types, changing the content types to include "application/octet-stream", and tried using the extension/content type for office 2003 instead of 2007/2010...Here is my code
Code:
Dim byteArray As Byte()
Using mStream As New MemoryStream
Using spreadSheetDoc As SpreadsheetDocument = SpreadsheetDocument.Create(mStream, SpreadsheetDocumentType.Workbook)
Dim workBPart As WorkbookPart = spreadSheetDoc.AddWorkbookPart
Dim workSPart As WorksheetPart = workBPart.AddNewPart(Of WorksheetPart)()
[code]...
View 3 Replies
Sep 26, 2010
I have a little web app derived from one template (LinkDirectory). It works fine both on local and on live website.
But, when I download the database (which is filled with valud data, visible in the web app) from the website data (for maintenance purposes), it appear empty (no tables) in my local wite.
What did I miss ? is there a better way to get the database back home ?
View 10 Replies
Mar 16, 2011
One of my sites is on HTTPS and includes a document repository which has a lot of Office documents (.doc, .docx, xls, etc...)
We recently found that these may not be downloaded using IE8. Further research led me to this article.
[URL]
The resolution states to "remove the no-cache header" which is required by design. I found the following article describing how to do so:
how do i remove the security risk, due to cached version of page.
Unfortunately, the methods explained have not worked.
View 1 Replies
Dec 10, 2010
I am working on a web application and in ASp.Net using VB.net. The requirement is to create a csv file on the server and the user should be able to save the file on his machine. I am creating a csv file on the server and throwing the contents of the csv file to the user using Response.Write method.The problem I am facing is instead the csv file content, user is getting the html code of the page which he is accessing I wrote the following code in my aspx.vb :
strPhysicalPath = Server.MapPath("CSV/" & PathVirtual)
appendFileContents(AppStartupPath, "strPhysicalPath : " & strPhysicalPath)
Dim objFileInfo
As System.IO.FileInfo
objFileInfo = New System.IO.FileInfo(strPhysicalPath)
Response.Clear()
How can I get the csv content in the file that is being downloaded by the user?
View 10 Replies
Dec 10, 2010
i want to find the downloaded files full path.
in my case. iam replacing some data in document and saving in client side. so itz automaticaly saving in thw client side(normally in the Temp folder). i want to get that full path from the client side.
code
Response.AppendHeader("Content-disposition", "attachment; filename=myword.docx");
View 1 Replies
Apr 18, 2010
I've download and installed the AJAX toolkit. I'm using VS 2008 Pro/.NET 3.5/C#. When I add a textbox and then extend it with an AJAX control (i.e. watermark, calendar, etc.) and run the page. The page comes up fine but no watermark or calendar extension.
View 3 Replies
Jun 9, 2010
.sis file not properly downloaded via WAP
View 1 Replies
Aug 5, 2010
I have written the following code to download a file from sharepoint. The downloded file works fine in only some machines. For others, it says that the file is corrupted. The issue is for MS Office and image files, however the PDF is not having any issues. We have identified the issue of corruption as due to the addition of a hexadecimal number at the top of the file contents. When it is removed, the file gets opened correctly. The hexadecimal character has been traced out to be representing the file size in bytes. Why this is happening only in some machines and how can we fix it?
private void DownloadFile()
{
SPListItem item = GetFileFromSharepoint();
[code]...
View 1 Replies
Mar 11, 2010
I am currently following instructions in a book to develop an application. It asks me to download StructureMap and then move the StructureMap.Dll file and the Log4Net.dll into the bin files. The problem is there doesnt seem to be a Log4Net.dll file in the StructureMap files, the only other dll apart from the StructureMap.dll is the Rhino.Mock.dll.
View 2 Replies