Click here to Skip to main content
Click here to Skip to main content
Go to top

ISAPI Extension for sending faxes

, 26 Mar 2002
Rate this:
Please Sign up or sign in to vote.
An article on sending faxes through a Web page
<!-- Download Links -->

Introduction

Windows 2000/XP offers two possibilities to send faxes programmatically, either by a COM-Object (faxcom.dll) or by an API (winfax.dll). The COM object also can be used in script languages like JScript, however, it isn't so flexible as the API. Through the API on the other hand you receive control over the sending process during sending. To be able to send faxes by a web page, I have written an ISAPI extension using the Fax-API.

To use the fax API you must use the corresponding header files and libraries from the Microsoft Platform SDK. You can download the Platform SDK under http://msdn.microsoft.com/download free of charge.

Installation and configuration

To be able to use the ISAPI-Extension, the IIS and Microsoft Fax service must of course be installed and working faultlessly. Before you use the ISAPI-Extension you must test faxing by sending a document e.g. over Wordpad to the fax printer.

After it, create a new web folder and out of it an application by using the IIS-Manager. The "execution rights" of the application must be set to "script and executable files ", the application protection to "low (IIS process)":

 Through "Authentication methods" the anonymous access must be prevented: 

After it, you copy the ISAPI-Extension (FaxISAPI.DLL) and the necessary ASP files (default.asp, progress.asp and ready.asp) into the web folder. Now start the browser and enter the address to the web folder (e.g. "http://localhost/fax") and send a fax through the web page.

Implementation

The code of the FaxISAPI.DLL consists of three .cpp files. The file extension.cpp contains the functions for the ISAPI-Extension, upload.cpp contains the C++ class for the Upload, fax.cpp contains the C++ class for initializing the fax server and for sending faxes.

To inform the client about status information of the Upload and fax process, the ISAPI-DLL writes into a status file (this status file will be created in "c:\ winnt\temp" and the name of it corresponds to the Session ID + ".log").
The ASP file progress.asp is refreshed by the browser every second and the progress.asp reads the Status on the server from the status file.

The default.asp contains the HTML form to get the fax number from the user. The fax number then is passed to choosefile.asp. The file choosefile.asp contains the HTML form for the choice of the faxing file and calls the FaxISAPI.DLL at a "Submit" and opens simultaneously a new browser window by Javascript with the progress.asp.

Upload of the file to be faxed

The CUpload class contains the methods for the Upload of exactly one file to a web server. The class writes the number of bytes written to the status file and also the length of the file. This status information is used by progress.asp to show a progress bar. The uploaded file is stored intermediately in the folder "c:\winnt\temp".

Faxing the uploaded file

CFax contains the methods for the Initializing/Deinitialising (Init, DeInit) of the fax service and the method for sending Fax documents (send). The method Init of the ISAPI.DLL is called when loading the DLL the first time, DeInit when unloading the DLL. The real sending process of the fax document is implemented in CFax::Send. The ISAPI-DLL finish its work and sends a Redirect to ready.asp to the browser after the fax was sent. Ready.asp then gives the user information about whether the fax could be successfully sent.

Conclusion

Through the fax API you can access all essential events of the fax service.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Sönke Cordts
Web Developer
Germany Germany
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 Pinmemberbehzad200015-Oct-13 20:20 
Questionthe web not run. only refresh Pinmemberhoacksl28-Apr-12 22:52 
Questionwhat am I missing? Pinmemberzepp24-May-06 17:35 
GeneralWorks fine just one time PinmemberEric-7722-May-06 1:01 
GeneralCan't get it to work. Pinmembersupz22-May-06 0:00 
GeneralRe: Can't get it to work. Pinmembersupz22-May-06 1:03 
GeneralRe: Can't get it to work. Pinmembersupz8-Jan-07 19:34 
Generalpossible error in CUploadFile Pinmemberbartm10-May-06 0:48 
GeneralErreur Interne Pinmemberfabfoot27-Apr-06 4:12 
GeneralIT SIMPLY DOESN'T WORK! Pinmemberfatehh14-Jul-05 2:56 
GeneralRe: IT SIMPLY DOESN'T WORK! PinmemberMohit Raj31-Jul-05 18:24 
GeneralAbout fax project Pinmemberkrish2k59-Apr-05 0:02 
GeneralRe: About fax project PinmemberMohit Raj31-Jul-05 18:16 
GeneralSending Multiple Fax (2) Pinmemberalberto_mecho26-Nov-04 5:26 
GeneralSending multiple fax Pinmemberalberto_mecho26-Nov-04 1:49 
GeneralRectification note Pinmemberalberto_mecho26-Nov-04 3:29 
Questionpre-requisites? Pinmembernsmalwankar20-Oct-04 11:14 
AnswerRe: pre-requisites? PinmemberMohit Raj31-Jul-05 18:19 
Generalerror in sending fax Pinmemberhi_hemant141-Jun-04 3:02 
GeneralFaxes are &quot;too light&quot; PinmemberNeil Katalino21-Apr-04 2:32 
GeneralCan't Run Pinmembergarfieldlau13-Apr-04 20:30 
GeneralRe: Can't Run PinmemberMohit Raj30-Sep-04 18:44 
GeneralRe: Can't Run Pinmembernsmalwankar20-Oct-04 10:12 
QuestionHow dees this DLL handle a multi-user enviroment? Pinmembersivas@webtraveller.com.au22-Feb-04 18:57 
Generalerror Pinmembercan prox3-Dec-03 1:04 
GeneralDoesn't create the sessionid.log file in winnt\temp folder PinmemberAlok Dash24-Sep-03 0:59 
GeneralRe: Doesn't create the sessionid.log file in winnt\temp folder PinmemberSönke Cordts24-Sep-03 1:02 
Generaljava fax Pinmembernowmedia22-Jul-03 0:21 
GeneralRe: java fax Pinmemberliuxiao121724-Nov-03 18:22 
GeneralISAPI in C# PinmemberArash Sabet21-Jul-03 5:41 
GeneralSolutions PinsussAnonymous14-Jun-03 0:25 
Generalcan't build the dll Pinmemberjosephwang30@yahoo.com11-Jun-03 0:38 
GeneralRe: can't build the dll Pinmember[ELNINO]6-Apr-04 1:17 
GeneralRe: can't build the dll Pinmembernsmalwankar29-Oct-04 9:21 
GeneralError PinmemberCiel.Zanato8-Jun-03 1:53 
GeneralHelp needed PinmemberQayyum Asma20-May-03 17:59 
QuestionWorked examples? PinmemberButter0822-Jan-03 4:40 
GeneralFaxSendDocument and HTML format PinmemberMukesh27-Nov-02 19:38 
GeneralRe: FaxSendDocument and HTML format PinmemberLukCastles17-Dec-02 2:28 
Generalwhy,help me Pinsussansonding23-Oct-02 23:45 
GeneralRe: why,help me Pinmemberaspprog27-Dec-02 17:15 
Generalplease help me Pinmemberchiranjeevi23-Oct-02 16:36 
GeneralInternal Server Error PinsussKendo6523-Oct-02 14:20 
GeneralRe: Internal Server Error PinmemberErkang Zheng4-Dec-03 8:08 
GeneralRe: Internal Server Error Pinmembervampiresoft6-Dec-03 11:53 
GeneralRe: Internal Server Error Pinmemberfucking hostile7-May-04 2:23 
GeneralRe: Internal Server Error Pinmemberfabfoot27-Apr-06 3:47 
GeneralWinFax lib/.h file PinsussAnonymous10-Oct-02 1:11 
GeneralRe: WinFax lib/.h file PinmemberSönke Cordts10-Oct-02 2:00 
GeneralError: data is invalid PinsussAnonymous19-Sep-02 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 27 Mar 2002
Article Copyright 2002 by Sönke Cordts
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid