473,387 Members | 1,742 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,387 software developers and data experts.

Write Data to Binary File

Hi Friends,

I have one EXE file that customer need to download from my website. But I
have one text file of Max 250 bytes of text in in that I want to append to
the END of the Binary EXE file and give that for download to user. How can I
do that. Please suggest. I think we need to go for some BinaryWrite kind of
procedure using ADO Stream.

Please suggest
Prabhat
Apr 29 '06 #1
6 2466
You could possibly use the document footer feature -
http://technet2.microsoft.com/Window...07fc11033.mspx

Apr 29 '06 #2

<an******@gmail.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
You could possibly use the document footer feature -
http://technet2.microsoft.com/Window...396e-2149-461d
-b6e7-bd1625f07fc11033.mspx


No. I want to append some Text (Content of some small text file having 2
lines: Ex: "MyText.txt") in one of the EXE file (Binary File) Ex:
"MyApplication.exe" using ASP, in webserver. How can I do that?

Apr 29 '06 #3
Your choices:
1. Have IIS download the EXE file as a static file, and configure Footer for
that file only
2. Have an ASP page which reads the EXE file and BinaryWrite's the text file

Of course, you can do whatever you want. If you insist on writing ASP code,
go right ahead; most people prefer the Static File and Footer approach
because it's just configuration - no code necessary.

Aren't you corrupting the EXE by appending the text?

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Prabhat" <no********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...

<an******@gmail.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
You could possibly use the document footer feature -

http://technet2.microsoft.com/Window...396e-2149-461d
-b6e7-bd1625f07fc11033.mspx


No. I want to append some Text (Content of some small text file having 2
lines: Ex: "MyText.txt") in one of the EXE file (Binary File) Ex:
"MyApplication.exe" using ASP, in webserver. How can I do that?

Apr 30 '06 #4

"David Wang [Msft]" <so*****@online.microsoft.com> wrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Your choices:
1. Have IIS download the EXE file as a static file, and configure Footer for that file only
2. Have an ASP page which reads the EXE file and BinaryWrite's the text file
Of course, you can do whatever you want. If you insist on writing ASP code, go right ahead; most people prefer the Static File and Footer approach
because it's just configuration - no code necessary.

Aren't you corrupting the EXE by appending the text?

--
//David
IIS


Hi David,

Thanks for your suggestion. I did not know abt the Footer one. How can I do
that in IIS 5.0 on windows 2000 Serv? Can we set the Footer only for one EXE
? Can you help me in that?

Thanks
Prabhat
May 1 '06 #5
This sounds like a one-off case, so just create a vdir which points to that
..EXE and set the vdir to append Footers to all resources within it.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Prabhat" <no********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...

"David Wang [Msft]" <so*****@online.microsoft.com> wrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Your choices:
1. Have IIS download the EXE file as a static file, and configure Footer

for
that file only
2. Have an ASP page which reads the EXE file and BinaryWrite's the text

file

Of course, you can do whatever you want. If you insist on writing ASP

code,
go right ahead; most people prefer the Static File and Footer approach
because it's just configuration - no code necessary.

Aren't you corrupting the EXE by appending the text?

--
//David
IIS


Hi David,

Thanks for your suggestion. I did not know abt the Footer one. How can I
do
that in IIS 5.0 on windows 2000 Serv? Can we set the Footer only for one
EXE
? Can you help me in that?

Thanks
Prabhat

May 2 '06 #6

"David Wang [Msft]" <so*****@online.microsoft.com> wrote in message
news:OH*************@TK2MSFTNGP04.phx.gbl...
This sounds like a one-off case, so just create a vdir which points to that .EXE and set the vdir to append Footers to all resources within it.

Hi Thanks for your suggestion. But I have wrote code (in VB DLL) that will
take path fore Source Text File and Source Binary File and Append the Text
to the Binary File at END. I understand that I am modifying a Binary File -
But I know that I am not currupting it.

Thanks for your help
Prabhat
May 2 '06 #7

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

Similar topics

3
by: kee | last post by:
Hi All, I am trying to write binary data to a file, which is bmp image: Open "d:\temp\test001.bmp" For Binary Access Write As #1 Put #1, 1, strImage Close #1 *** strImage contains binary...
1
by: Elliot Marks | last post by:
I want to output this data to text and binary files. The binary file contains the garbage you would expect to see if you try to read it with a text editor, but below that the output appears as...
4
by: Tom Van Ginneken | last post by:
Hi, I need to write binary data to a serial port. I am using this function: #include <unistd.h> ssize_t write(int fd, const void *buf, size_t count); I am able to write a alpha-numeric...
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...
2
by: Thomi Aurel RUAG A | last post by:
Hy I'm using Python 2.4.2 on an ARM (PXA-270) platform (linux-2.6.17). My Goal is to write a list of bytes down to a file (opened in binary mode) in one cycle. The crux is that a '0x0a' (line...
13
by: zach | last post by:
Can someone help me out, I can't figure out what I'm doing wrong to write to a file in binary mode. What's wrong with my code? <?php $fileName = "something.dat"; $string = "This is a...
6
by: aagarwal8 | last post by:
Hi, I am trying to write the contents of a textbox to a file in binary format. My code looks like this... private void btnWriteToFile_Click(object sender, EventArgs e) { FileStream fs =...
1
by: =?Utf-8?B?U3RldmVU?= | last post by:
I have a structure that contains both 32x32 and 16x16 icons plus some text. I want to write all this to an XML file so that I can recover the icons later in an application. Can someone tell me how...
1
by: xiao | last post by:
HI~ guys , I have a program here (Sorry it is very long about 240 lines.) It can read and write the header information successfully but it cannot write the array successfully. I guess there is...
1
by: Sachin Garg | last post by:
I have a program which opens a fstream in binary input+output mode, creating the file if it doesn't exists. But writing doesn't works after reading, it must be something obvious that I am not aware...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.