|
-
Dec 16th, 2000, 03:52 AM
#1
Thread Starter
Addicted Member
Hey guys, your fellow VB and ASP programmer Xenonic Rob here. Just a question - is it possible to send an image as a response from an ASP script, without any components? I mean, so you could call it from an HTML page like this:
<IMG Src="http://www.server.com/script.asp?varible=value">
Is it possible?
-
Dec 16th, 2000, 11:04 AM
#2
Sure, but you have to do it like this:
<IMG Src="http://www.server.com/script.asp?varible=<%=value%>">
Assuming that value contains a valid picture file.
-
Dec 16th, 2000, 11:10 AM
#3
Thread Starter
Addicted Member
You don't understand.
I mean I need to generate say a JPG file on the fly, so it can be called from a normal HTML docuemnt. I don't mean another ASP script.
-
Dec 16th, 2000, 04:44 PM
#4
Frenzied Member
Not without software to do Jpg compression. Where does the image come from? Thin air? What would you create an image of? You would HAVE to have some sort of component on the server generating the image in the first place. (Unless you can response.write the exact binary sequences needed to produce an image- not likely)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Dec 17th, 2000, 05:43 AM
#5
Thread Starter
Addicted Member
monte96 - hey - chill out!
There's no need to get so stressy with me! I was just enquiring whether it would be possible to load a JPG off the server or something, and then Response.Write that in....
Man - you need to take a chill pill!!
-
Dec 18th, 2000, 10:40 AM
#6
Frenzied Member
Sorry..didn't think I was 'stressy' but whatever..
I guess I don't understand what you're trying to do either cuz:
<IMG src="image.jpg">
would load an image off the server. Other than add some server load, I'm not sure what you would accomplish. Unless your trying to load a different pic depending on different situations then you can just response.write the different filename into the src attribute.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Dec 20th, 2000, 08:43 PM
#7
Addicted Member
Hi there,
How about creating the jpg file on the server from within the asp script and then making a reference to it from the client?
If it is possible to create a jpg file like that using VBScript, could you pls post the code? I will be very grateful.
-
Dec 21st, 2000, 10:37 AM
#8
Frenzied Member
This is where I point out my previous argument: You can't create a jpg with just VBScript. You have to have some kind of external component on the server. You could have a component that renders text as images using predetermined fonts, BUT you would have to have created the component in something other than VBScript and it would have to have the ability to do jpg compression of images when it outputs the image to the server. The component could return the name of the file to the calling function in script and then an image tag could be constructed. (sorry if this sounds stressy..)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Dec 21st, 2000, 01:06 PM
#9
Thread Starter
Addicted Member
OK - try this out:
I'm doing a hit counter service, and I want users to be able to show their hitcounter like <Img src="www.myserver.com/script.asp?account=theiraccount"> Because of this, I want to be able to string together a combination of 4 digits, so thats 4 GIF images. Is this possible in pure VBScript?
-
Dec 21st, 2000, 02:36 PM
#10
Banned
Yes, you'd have to pull up their hits from a database using a SQL string, and then use Select Case statements and string manipulation to go through each digit of the number of hits, and create a string of images. This will load an image for each digit. If you wanted a single image for the entire number, you'd need that server-side JPG compression thingy that the other guy was talking about.
-
Dec 22nd, 2000, 04:11 AM
#11
Addicted Member
pactalon,
He wants the asp script to return an image. I don't think it is possible do you?
-
Dec 22nd, 2000, 06:32 AM
#12
Addicted Member
It doesn't work. I have tried it with Scripting.FileSystemObject. Here is what I have done.
<%
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextStream("c:\my file.jpg")
a = f.ReadAll
Response.Write a
%>
The result does not show a picture in the browser window.
-
Dec 22nd, 2000, 04:32 PM
#13
Banned
You would need a third-party image compression component. Ask the guy who runs http://www.cooltext.com for advice.
-
Dec 23rd, 2000, 04:29 AM
#14
Thread Starter
Addicted Member
Thanks guys for all your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|