Storages & Files Value property
Value Read/Write property.

Gets/sets the data in the buffer. When set the value deletes the current buffer and creates new one containing the assigned data. Therefore after setting the Value property the buffer size will match the size of the value set (in bytes). See the remarks.


object.Value = value
variable =


Response.BinaryWrite o.Value
' Outputs binary data to ASP response.


The data being set must be of VT_UI1 | VT_ARRAY (array of bytes) type. The returned data is in the same format. This is a de-facto standard when binary values are transferred and should be compatible with virtually any existing object which supports binary data (the streams in this library, ADO, ASP and many others).

Reading a file into the buffer. To read a file in the buffer you will need an opened SFStream object. Example below illustrates the technique:

Set o = Server.CreateObject("newObjects.utilctls.SFBinaryData")
Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
Set file = sf.OpenFile(Server.MapPath("test.bin"))
o.Value = file.ReadBin(file.Size)

You can also initialize a SFBinaryData object with binary data from other streams or from other sources. For example you can read a binary post in an ASP page directly in one line:

Set o = Server.CreateObject("newObjects.utilctls.SFBinaryData")
o.Value = Request.BinaryRead(Request.TotalBytes)

And then you can process it further.

Applies to: SFBinaryData object

See also: Size property

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later


newObjects Copyright 2001-2006 newObjects [ ]