Solved

Create Binary file in ASP

Posted on 2001-06-27
4
494 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP Focus problem 3 72
Error viewing ASP page 12 179
return false must be hit after calling certain command 10 45
IIS 7 and executing pages using localhost 16 26
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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…

730 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