473,769 Members | 5,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.WriteB inary problem

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 res = Server.CreateOb ject("ResCom.Re sizer")
grr = res.ResizeFile( "c:\inetpub\www root\perl\test. jpg", 100)
Response.Conten tType = "image/jpeg"
Response.Binary Write(grr)
Response.Flush

....and it appears as a broken image. If I download the web page it creates
with 'wget', it looks like BinaryWrite is padding every character from the
string with a hexadecimal 0 (unicode?), thereby doubling the output in size
and making it unusable. If I use Response.Write, it (naturally) doesn't work
either.

I've tried returning a VT_UI1, VT_BSTR or VT_ARRAY from the component, and
it doesn't make any difference.

Any recommendations ?

Thanks,

Gunther
Jul 19 '05 #1
0 1825

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

Similar topics

1
2723
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 users. I am adding the MIME type for the type of file that I am writing out to the response. Example: if ( reportName.ToLower().EndsWith(".pdf")) {
3
2825
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 Session("UserType") = "Sales". Then based on the Session("UserType") I use response.redirect to take the user to a specific page. The logic and response.redirect works fine on a Win2k server but when I move the page to a server running Win2003 the...
6
3058
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 cookie (say Response.Cookies ("TEST")) and you have a query string variable &test=x or &Test=x and you get Request.QueryString to parse the query string, the cookie that gets dropped matches the case of the query string, not what your code says. ...
0
1094
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 users. I am adding the MIME type for the type of file that I am writing out to the response. Example: if ( reportName.ToLower().EndsWith(".pdf")) {
5
9150
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 that way, but i left it in anyway. little did i know it would cause a problem for a forced download routine i have. instead of downloading the .xls attachment, it tried to download the aspx file, and gave an error saying the file could not be...
5
4572
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 a session variable, and if it is not present, does a Response.Redirect to a webpage for the CAS passing a url parameter for the url to post back to. The CAS provides a page for the user to log into, validates the username and password, and then...
2
2466
by: Dave | last post by:
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...
1
3631
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 HTML for the web page appended to the document when it's received. Example... This line was entered in the *.txt file prior to upload. Everything below this was added when retrieving from SQL. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
0
9590
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.