473,396 Members | 1,935 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.

Binary write.

I'm having problems with a simple binary write.
The page is just supposed to write a JPEG back to the browser but the image
does not display (the "X" image shows).
Any help is appreciated. Here's the full code:

<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "image/jpeg"
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fl = fso.GetFile("c:\afterWF.jpg")
Response.BinaryWrite fl
%>
Jul 19 '05 #1
7 21470
Fernando Chilvarguer wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:
I'm having problems with a simple binary write.
The page is just supposed to write a JPEG back to the browser but the
image does not display (the "X" image shows).
Any help is appreciated. Here's the full code:

<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "image/jpeg"
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fl = fso.GetFile("c:\afterWF.jpg")
Response.BinaryWrite fl
%>


No rights on reading c:\ ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
The Internet Guest Account has full rights for that file (read, write,
etc..) When testing, I added the "response.write(fl.Name)" line and it
displayed the file name. Making me assume that the file is being read into
the fl object correctly.

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Fernando Chilvarguer wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:
I'm having problems with a simple binary write.
The page is just supposed to write a JPEG back to the browser but the
image does not display (the "X" image shows).
Any help is appreciated. Here's the full code:

<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "image/jpeg"
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fl = fso.GetFile("c:\afterWF.jpg")
Response.BinaryWrite fl
%>


No rights on reading c:\ ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #3
Fernando Chilvarguer wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Fernando Chilvarguer wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:
> Response.ContentType = "image/jpeg"
> set fso = Server.CreateObject
> ("Scripting.FileSystemObject")
> set fl = fso.GetFile("c:\afterWF.jpg")
> Response.BinaryWrite fl


No rights on reading c:\ ?

The Internet Guest Account has full rights for that
file (read, write, etc..) When testing, I added the
"response.write(fl.Name)" line and it displayed the
file name. Making me assume that the file is being
read into the fl object correctly.


Fernando, it was just a suggestion.

[Please do not bottomquote on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4
[overquoting because I believe in it]
I think that you might be better off using an ADODB stream than the FSO for
binary files. Code like so:

<%
Response.ContentType = "image/jpeg"
Set oStream = Server.CreateObject("ADODB.Stream")
Response.BinaryWrite oStream.LoadFromFile("C:\afterWF.jpg").Read
oStream.Close : Set oStream = Nothing
%>

Ray at work


"Fernando Chilvarguer" <fe******@nospamimpex.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The Internet Guest Account has full rights for that file (read, write,
etc..) When testing, I added the "response.write(fl.Name)" line and it
displayed the file name. Making me assume that the file is being read into
the fl object correctly.

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Fernando Chilvarguer wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:
I'm having problems with a simple binary write.
The page is just supposed to write a JPEG back to the browser but the
image does not display (the "X" image shows).
Any help is appreciated. Here's the full code:

<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "image/jpeg"
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fl = fso.GetFile("c:\afterWF.jpg")
Response.BinaryWrite fl
%>


No rights on reading c:\ ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Jul 19 '05 #5
It worked!!!!

Thanks!!

PS: I had to add oStream.Open before loading from the file

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
[overquoting because I believe in it]
I think that you might be better off using an ADODB stream than the FSO for binary files. Code like so:

<%
Response.ContentType = "image/jpeg"
Set oStream = Server.CreateObject("ADODB.Stream")
Response.BinaryWrite oStream.LoadFromFile("C:\afterWF.jpg").Read
oStream.Close : Set oStream = Nothing
%>

Ray at work


"Fernando Chilvarguer" <fe******@nospamimpex.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The Internet Guest Account has full rights for that file (read, write,
etc..) When testing, I added the "response.write(fl.Name)" line and it
displayed the file name. Making me assume that the file is being read into the fl object correctly.

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Fernando Chilvarguer wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:

> I'm having problems with a simple binary write.
> The page is just supposed to write a JPEG back to the browser but the > image does not display (the "X" image shows).
> Any help is appreciated. Here's the full code:
>
> <%@LANGUAGE="VBSCRIPT"%>
> <%
> Response.Expires = 0
> Response.Buffer = TRUE
> Response.Clear
> Response.ContentType = "image/jpeg"
> set fso = Server.CreateObject("Scripting.FileSystemObject")
> set fl = fso.GetFile("c:\afterWF.jpg")
> Response.BinaryWrite fl
> %>
>

No rights on reading c:\ ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)



Jul 19 '05 #6
Ray at <%=sLocation%> wrote on 21 nov 2003 in
microsoft.public.inetserver.asp.general:
[overquoting because I believe in it]


Ray, you are so important to this NG and your conviction is well known,
I won't quarrel with you about that.

==========================

But then sci.lang.translation taught me that:

overquoting = quoting to much, [and you do not]
underquoting = quoting not enough

topquoting = bottomposting
bottomquoting = topposting
interquoting = interposting

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #7

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...

Ray, you are so important to this NG and your conviction is well known,
I won't quarrel with you about that.
Aw, shucks... Thanks Evertjan.

But then sci.lang.translation taught me that:

overquoting = quoting to much, [and you do not]
underquoting = quoting not enough
Damn web-based usenet access.

topquoting = bottomposting
bottomquoting = topposting
interquoting = interposting


I like that list of terms. Thanks. Interquoting would be my quoting of
choice, I suppose.

Ray at work

Jul 19 '05 #8

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

Similar topics

6
by: Sebastian Kemi | last post by:
How should a write a class to a file? Would this example work: object *myobject = 0; tfile.write(reinterpret_cast<char *>(myobject), sizeof(*object)); / sebek
103
by: Steven T. Hatton | last post by:
§27.4.2.1.4 Type ios_base::openmode Says this about the std::ios::binary openmode flag: *binary*: perform input and output in binary mode (as opposed to text mode) And that is basically _all_ it...
8
by: Yeow | last post by:
hello, i was trying to use the fread function on SunOS and ran into some trouble. i made a simple test as follows: i'm trying to read in a binary file (generated from a fortran code) that...
28
by: wwj | last post by:
void main() { char* p="Hello"; printf("%s",p); *p='w'; printf("%s",p); }
4
by: knapak | last post by:
Hello I'm a self instructed amateur attempting to read a huge file from disk... so bear with me please... I just learned that reading a file in binary is faster than text. So I wrote the...
12
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
3
by: Billy Smith | last post by:
I'm trying to write a little utility that will write some binary data to a file via a javascript and Windows Script Host under Windows XP. The only way to do this that I can find is to convert...
3
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
15
by: JoeC | last post by:
I am writing a program that I am trying to learn and save binary files. This is the page I found as a source: http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html I have...
10
by: rory | last post by:
I can't seem to append a string to the end of a binary file. I'm using the following code: fstream outFile("test.exe", ios::in | ios::out | ios::binary | ios::ate | ios::app)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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.