Solved

Response.ContentType : reading file from database (binary) will append html code !

Posted on 2007-03-21
6
570 Views
Last Modified: 2008-01-09
hi experts:
I m using MS 2005 with .net 2.0

my app save  file into database table in binary type, and then i will retrieve it to open and view it.
Everytime work ok. But  i found that now if i open from database a text file (.txt) from my own machine localhost then nothing wrong with the content, but when i deploy to another server and access the same app (on that server ) and open the file again,the content of the text file will append the html code of current page below the orignal contents!!

pls help...


0
Comment
Question by:qfren
  • 2
  • 2
6 Comments
 
LVL 1

Expert Comment

by:bennyshoham
ID: 18770466
use  Response.Clear(); before starting to write the response.
0
 
LVL 8

Author Comment

by:qfren
ID: 18777866
hi,

Thanks for reply.
i did it in exisiting code.
0
 
LVL 1

Expert Comment

by:bennyshoham
ID: 18778235
Please attach existing code so i can see what is missing.
0
 
LVL 8

Accepted Solution

by:
qfren earned 0 total points
ID: 18791398
hi,
I find out what is the cause already.
i append  Response.End()  after response object into my existing code and it solve the problems!
Anyway , thanks for your comment!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now