Sales
Click for numbers
Welcome User Tools Developer Tools Prices Help Sign up Login
You are here: Home > Developer Tools > Fax Web Service > Samples > ASP.NET (ASPX) - Retrieve the image of a submitted fax

ASP.NET (ASPX) - Retrieve the image of a submitted fax

This script requires a proxy object which can be downloaded  here. To create a fresh proxy class, see instructions   here.

<%@ Page Language="vb" %>
<%

'
'
Dim oSF As New interfax.InterFax() 'Reference to Interfax object
Dim intRet As Integer
Dim B() As Byte

'
' Invoke Interfax FaxStatus method
'
intRet = oSF.GetFaxImage("<Username>","<password>", 2484342 , B)
If intRet <> 0 Then

'
' An error occured - see documentation
'
Response.Write("Error !! " & intRet)
Else

'
' A normal response returned from Interfax server
' Save the file
'
Dim fs As System.IO.FileStream 'Reference to Filestream object

'
' Make sure the file exists and ASPX script has access to the file.
'
fs = IO.File.Open("C:\temp\Out.tif", IO.FileMode.Create, IO.FileAccess.Write)

'
' Allocate a byte array according to file length
'
'
' Read the entire file
'
fs.Write(B, 0, B.Length)
fs.Close
fs = Nothing

'
' Clean up
'
oSF = Nothing
Response.Write("File created. Size: " & B.Length & " bytes")
End If
%>




About | Contact | Privacy | Terms | Partners | Login | System Status

© Interfax Inc