Solved

Create Binary file in ASP

Posted on 2001-06-27
4
493 Views
Last Modified: 2012-06-21
How can I create a binary file and write binary content to a file in ASP?

Thnak ahead.

 
0
Comment
Question by:nixonc
4 Comments
 
LVL 7

Accepted Solution

by:
weesiong earned 50 total points
ID: 6233704
nixonc,

This is a little bit hard, but you can see example,

http://www.activefusion.com.sg/it31/20000316.zip

Regards,
Wee Siong
0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6233712
'Create an instance of the FSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Create the object and the binary file to write to
Set objBinaryFile = objFSO.CreateTextFile(Server.MapPath("outputfile.ext"))
'Write the information to the file
objBinaryFile.Write binInformation
'Close the file
objBinaryFile.Close
'Clean up
Set objFSO = Nothing


Should note that you should change the outputfile.ext to whatever filename you want and should change the binInformation variable to whatever variable name your binary information is stored in.

Hope this helps.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6233720
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6234504
If you have a binary stream.. create the file using fso.. you can open the file as

set objBinaryFile = Server.CreateObject("BinaryFileStream.Object")
Response.BinaryWrite objBinaryFile.GetFileBytes(CStr(strFileName))
set objBinaryFile = nothing

BinaryFileStream object dll can be found here:
http://download.microsoft.com/download/excel2000/sample/2000/w9x2k/en-us/ChartGIF.exe
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Select only the top record in a left join 13 45
Multiflying 2 Input Text On a Table 7 31
Html fieldset fix its height and width 4 29
Html value of radio 14 27
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question