<% 
' Copyright 2000 Phone.com, Inc.  All rights reserved.
'
'   Subject to the terms and conditions of the SDK License Agreement,
'   Phone.com, Inc. hereby grants you the right to use the UP.SDK
'   software and its related documentation.
'
'   The Phone.com name and logo and the family of terms carrying the "UP."
'   prefix are trademarks of Phone.com, Inc. All other brands and product
'   names may be trademarks of the respective companies with which they
'   are associated.
'
'   addImageFromFile .asp
'
'   A VBScript example to illustrate adding a deck, and an image,
'   read from a local file using the Server Object MapPath method. 
'
' Declarations 
' 
Dim myDigest, deck1, imgPath, nl, digestString

' A newline (linefeed) is appended to each line of WML to
' aid legibility of source dumped to the Sim Info Window.
'
' Constants
' 
nl      = Chr(10)

' Specify the deck content.
'
deck1   =         "<wml>" & nl
deck1   = deck1 & "  <card>" & nl
deck1   = deck1 & "    <p>" & nl
deck1   = deck1 & "      <img alt="" Logo bitmap "" src=""logo"" />" & nl
deck1   = deck1 & "      <br/>Logo bitmap image" & nl
deck1   = deck1 & "    </p>" & nl
deck1   = deck1 & "  </card>" & nl
deck1   = deck1 & "</wml>" & nl

' Map the path to the location of the image file to a variant, imgPath
'
imgPath                 = Server.MapPath("../images/logo.bmp")

' Create a COM Digest object.
'
set myDigest            = Server.CreateObject("PDCDigestUtils.CPDCDigest")

' Add a deck to the digest object using an empty relative URL. 
'
myDigest.DigestAddDeck  "", deck1

' Add an image file to the deck by referencing the mapped path buffer.
'
myDigest.DigestAddImageFromFile "image/bmp", "logo", imgPath

' Suppress content type output within the digest to prevent a 
' server from encapsulating WML content within a second boundary.
'
myDigest.DigestSuppressContentType 1

' Serialize the digest into a single output buffer, digestString.
'
digestString    = myDigest.DigestSerialize(0)

' Specify a deck of type WML to the digest object.
'
myDigest.DeckType         = 1

' Specify content type through the server response,
' rather than within the digest.
'
Response.ContentType    = myDigest.DigestGetContentType

' Write the response buffer to the client.
'
Response.BinaryWrite(digestString)
%>

