Closed Bug 338533 Opened 19 years ago Closed 19 years ago

Using BinaryWrite loads the page twice

Categories

(Firefox :: General, defect)

defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 304574

People

(Reporter: vince, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3 Hi there, I've looked around and I can't find anything on this, I hope it's not a duplicate. Ok, so what i've got is an ASP script running on a Windows 2003 server, the script has a single include file which contains a load of functions and nothing else. In the main script, I take details passed through to it from the URL and write a record to a database. The final part of the script retrieves a 1x1 image and writes it to the browser using the function BinaryWrite. The problem, when using Internet Explorer, everything works fine, a single record is recorded and the image is correctly displayed. However, on Firefox, two records are inserted for each page visit, the image is displayed correctly though. On debugging through my code, the problem seems to occur on the line that I do the BinaryWrite, commenting this out means that just one record is inserted, which is correct. I have tried various both MySQL and Access as the database and the results are the same. In additional information, I have included the code that i'm using to return the image to the browser. I have got around the problem by not BinaryWrite'ing to the browser, instead, i'm just using a response.redirect and redirecting to the image. This works just fine, it would be nice to do it the other way though. Hope that's enough info and it's very sunny where you are! Hooray for Firefox!! Vince. Reproducible: Always dim buf buf = ReadBinaryFile(server.mappath("hitimage.gif")) Response.ContentType = "image/gif" Response.Addheader "Content-Disposition", "inline; filename=hitimage.gif" Response.Addheader "Content-Length", LenB(buf) Response.BinaryWrite(buf) Response.End()
*** This bug has been marked as a duplicate of 304574 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.