Fax ASP – Get Submitted Fax Image (VB.NET fax code)

25 Nov 2016 This code sample is deprecated and in process of being removed. Check out our new code libraries and usage documentation on InterFAX @ Github.

In this sample, you learn how to retrieve the image of a submitted fax with ASP, using VB.NET fax code (aspx.vb). This is done with the GetFaxImage method.

The fax ASP script below uses VB.NET fax code to retrieve the image of an outbound (previously-submitted) fax.

A proxy object is required for this script. Download it here, or learn how to create a fresh proxy class 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("","", 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
%>