473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Response.WriteBinary problem.

I've been working on a small page that allows my users to publish and
retrieve documents from a SQL database. Everything appears to be
working fine with exception of 2 things.

1.) Any file that can be opened and edited with the NotePad, once the
file has been uploaded to the SQL Server, when it's retrieved it has
the HTML for the web page I'm retrieving the file with. Below is an
example of a text file that I uploaded.

File Content Example:

This lline was entered in the *.txt file before uploading. Everything
below this was added when retrieving from SQL.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title>
<link href="App_Themes/j....

End Example

2.) Office 2007 format documents retrieve as being corrupt.

Is Response.WriteBinary the proper way to do this...and if so, can you
give me some insite as to where I might be able to fix this problem?

Any help would be greatly appreciated.
Oct 27 '08 #1
2 2442
On Mon, 27 Oct 2008 13:39:25 +0100, Dave <Da**********@jacobs.comwrote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
From where are you making the call to the HttpResponse.WriteBinary method?

If you make the call from the code-behind of an ASPX-page (so it seems),
you might need to place the call between a Response.Clear() and a
Response.End(), to be sure that no markup is added to your output.

Example:

Response.Clear();
Response.WriteBinary(data);
Response.End();

--
Joern Schou-Rode
http://malamute.dk/
Oct 27 '08 #2
Already replied in your other thread in the same newsgroup.

--
Göran Andersson
_____
http://www.guffa.com
Oct 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gunther Schmidl | last post by:
Hi, I've rolled my own perl component for resizing pictures on the fly, but I have a problem with actually outputting the resized image. Here's my code: Dim res Response.Buffer = true Set...
1
by: Adam B | last post by:
Hello. I'm writing an aspx page that reads a file from disk and writes the file out through the Response.WriteBinary() method. This allows me to support security and custom reports for various...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
0
by: Adam B | last post by:
Hello. I'm writing an aspx page that reads a file from disk and writes the file out through the Response.WriteBinary() method. This allows me to support security and custom reports for various...
5
by: Tim_Mac | last post by:
hi, i read that by adding the following code to by aspx pages, it would not store temporary internet files: Response.Cache.SetCacheability(HttpCacheability.NoCache); it didn't actually work...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
1
by: Dave | last post by:
I have a small web app that publishes files to a SQL database. I just noticed this morning that 2 conditions exist that I need help with. 1.) Any file that can be open with NotePad have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.