homepage Welcome to WebmasterWorld Guest from 184.73.104.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Creating Binary Files
and writing them to disk
joshie76

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 568 posted 4:38 pm on Apr 16, 2003 (gmt 0)

If I have some binary 'content' (i.e. from an image taken out of a database blob) I can easily stream this down to a client using the
Response.BinaryWrite method.

However, does anybody know how to write the binary file to disk on the web server using ASP (classic) & VBScript?

Had a look round and I can only see how to write text files and load binary files.

Thx in advance

Josh

 

duckhunter

10+ Year Member



 
Msg#: 568 posted 1:51 pm on Apr 18, 2003 (gmt 0)

Classic ASP, You can use the FILEPUT function: [msdn.microsoft.com ] (there's a perfect example at the bottom)

.NET you can use the System.IO.BinaryWriter class
[samples.gotdotnet.com ]

aspdaddy

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 568 posted 12:28 pm on Apr 21, 2003 (gmt 0)

I think the pure asp upload class [asp101.com] does this.

joshie76

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 568 posted 8:00 am on Apr 22, 2003 (gmt 0)

As far as I can see FilePut is a pure Visual Basic feature and is unavailable to VBScript (and therefore Classic ASP) - I've tried the examples without any success.

aspdaddy

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 568 posted 12:26 pm on Apr 22, 2003 (gmt 0)

Did you check out the class? It looks pretty straightfoward , it writes the binary content to disk using a loop:

Set oFile = oFS.CreateTextFile(sPath & FileName, True)
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved