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) - Fax a binary file

ASP.NET (ASPX) - More advanced fax transmission

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

<%@ Page Language="vb" %>

'
'The strFileType is a constant in this sample.
'
Dim objWS As Interfax.Interfax 'Reference to local webservice proxy connector
Dim SendFaxResult as integer
objWS = new Interfax.Interfax
Dim fs As System.IO.FileStream 'Reference to Filestream object

'
' Read data from binary file (PDF, Word, ...)
' Make sure the file exists and ASPX script has access to the file.
'
fs = IO.File.Open("C:\temp\1.pdf", IO.FileMode.Open, IO.FileAccess.Read)
'
' Allocate a byte array accoording to file length
'
Dim FilesData(fs.Length - 1) As Byte
'
' Read the entire file
'
fs.Read(FilesData, 0, fs.Length)
'
' Cleanup Stream
'
fs.Close
fs = Nothing

'
' Obtain the file type
'

objWS.SendfaxEx_2( "<Username>", "<password>", "+1 212 345 6789", "", FilesData, _
"PDF", FilesData.Length, Now, 3, "MyCSID", "", "", "Fax Subject", "myaddress@mydomain.com", _
"Letter", "Landscape", False, True)

objWS = Nothing

If SendFaxResult &gt; 0 Then
Response.Write("Fax submitted. Transaction ID: " & SendFaxResult)
Else
Response.Write("Error sending fax. Return code: " & SendFaxResult)
End If

%>




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

© Interfax Inc