[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 521
  • Last Modified:

Create Binary file in ASP

How can I create a binary file and write binary content to a file in ASP?

Thnak ahead.

 
0
nixonc
Asked:
nixonc
1 Solution
 
weesiongCommented:
nixonc,

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

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

Regards,
Wee Siong
0
 
FenatuCommented:
'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
 
Michel SakrCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now