Solved

Create Binary file in ASP

Posted on 2001-06-27
4
488 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now