Introduction

The LEADTOOLS FTP/HTTP features are available only in the LEADTOOLS Internet Pro toolkit. These features let you add the following capabilities to your application:

interact with web servers without requiring the use of a Web Browser.

programmatically send and receive files.

The functions for interacting with web servers and programmatically sending and receiving files are included in the FTP/HTTP API DLL, LTWEB14n.dll. These functions are documented in this help file.

The FTP/HTTP features come in a WIN32 edition so that it can support development of software applications for any of the following environments:

Windows 3.x NT
Windows 4.x NT
Windows 95
Windows 98

Summary of All Supported Image File Formats


Version History

Current version: | 14.5
Last update: | October 20, 2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Version 12.1


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS FTP/HTTP API has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS FTP/HTTP API has changed from Version 13 as follows:

LEADTOOLS FTP/HTTP API now supports UNICODE.


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS FTP/HTTP API has not changed from Version 12.1.


Version 12.1

Version 12.1 is the first version of LEADTOOLS FTP/HTTP API.

The rest of this topic lists the new functions in version 12.1.

L_InetFtpBrowseDir

L_InetFtpChangeDir

L_InetFtpConnect

L_InetFtpCreateDir

L_InetFtpDeleteDir

L_InetFtpDeleteFile

L_InetFtpDisConnect

L_InetFtpGetCurrentDir

L_InetFtpGetFile

L_InetFtpRenameFile

L_InetFtpSendBitmap

L_InetFtpSendFile

L_InetHttpCloseRequest

L_InetHttpConnect

L_InetHttpDisconnect

L_InetHttpGetResponse

L_InetHttpGetServerStatus

L_InetHttpOpenRequest

L_InetHttpSendBitmap

L_InetHttpSendData

L_InetHttpSendForm

L_InetHttpSendRequest

FTPBROWSECALLBACK


Copyright notice

Copyright Notices

©Copyright LEAD Technologies, Inc. 1991-2005. ALL RIGHTS RESERVED

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, DC120V154_32.DLL, LFDCR14N.DLL, DCSPROBACK.DLL, DCSPRO3SLR.DLL, LFDCS14N.DLL, and LFKDC14N.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996-2001. This software is based in part on the work of the Independent JPEG Group.

Portions of the LFCRW14N.DLL, LTCMP14.DLL, CDSDK.reg, CDSDK.dll, CDRAPCLS.dll, czs_ui.dll, deimg.dll, deImg010.dll, deImg110.dll, deImg153.dll, deimg301.dll, deimg401.dll, deImg404.dll, deimg602.dll, Deimg603.dll, DeImgd60.dll, pscAdimg.dll, pscCllct.dll, pscCStUI.dll, pscDcd.dll, pscDevUI.dll, pscDvlp.dll, Pscl2STI.dll, pscll.dll, pscParse.dll, pscSetup.dll, psdkdll.dll, psdkReg.dll, psParse.dll. file contain material that is © Canon, Inc. 2002

Portions of the LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Hewlett Packard, 1996.

Portions of the OCR/ICR/OMR Features and the help file for the OCR/ICR/OMR Features are ©Copyright Scansoft, Inc. 1995-2003. ALL RIGHTS RESERVED

Portions of the Barcode Modules contain material that is ©Copyright Axtel Inc., 1999.

Portions of the LEADTOOLS PDF Plug in and the LEADTOOLS Vector Imaging Pro are ©Copyright 1996, 2000 Artifex Software Inc. All rights reserved.

File filters for decoding MrSID ® and DjVu ® formats are provided under a license from Lizardtech, Inc.

The "FlashPix" format uses Microsoft's OLE structured storage.

Portions of the DICOM help files in Medical Imaging product line are reprinted with permission from the National Electrical Manufacturers Association ©Copyright 1998 by the National Electrical Manufacturers Association. All rights including translation into other languages, reserved under the Universal Copyright Convention, the Berne Convention or the Protection of Literacy and Artistic Works, and the International and Pan American Copyright Conventions.

Portions of LEADTOOLS Data Security Add On contain software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/), including cryptographic software written by Eric Young (eay@cryptsoft.com) and by Tim Hudson (tjh@cryptsoft.com). Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. Copyright Tim Hudson 1995-1998 (tjh@cryptsoft.com) All rights reserved.

Portions of LEADTOOLS Data Security Add On contain software based on the MD5 Message Digest Algorithm developed by RSA Data Security, Inc.. Copyright (c) 1991-92 RSA Data Security, Inc. All Rights Reserved.

Portions hereof licensed under US patent 5,327,254 and foreign counterparts.

Portions of the LEADTOOLS ICC Profiles material is © Copyright 2004, International Color Consortium.

Trademarks

LEAD® and LEADTOOLS® are registered trademarks of LEAD Technologies, Inc.

Microsoft, Windows, Windows NT, Visual Basic, Visual FoxPro, and Microsoft Access are either trademarks or registered trademarks of the Microsoft Corporation.

OS/2® is a registered trademark of International Business Machines Corporation.

TextBridge®OCR is a registered trademark of Scansoft, Inc.

ISIS® is a registered trademark of Pixel Translations, Inc.

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

All other brand or product names used in this online help are trademarks of their respective holders.

Address and Contact Information

LEAD Technologies, Inc.
1201 Greenwood Cliff, Suite 400
Charlotte, NC 28204

(704) 332-5532
FAX: (704) 372-8161
Technical support: (704) 372-9681 or Support@Leadtools.com
Home page: http://www.leadtools.com


Programming with LEADTOOLS FTP/HTTP

Working with HTTP Functions

How to Program with FTP Functions


How to Program with FTP server Functions

How to Program with FTP Functions

FTP Internet functions allow a user to create a connection with an FTP server, transfer files and bitmaps, perform remote file operations, perform remote director operations, and browse remote directories for files. The following topics provide a systematic approach to understanding how to program with the LEADTOOLS FTP functions.

Connecting and Disconnecting to the FTP Server

The first step in working with a FTP server is to use L_InetFtpConnect to connect to the desired FTP server. A user can connect with a user name and password, or as an "anonymous" user. To disconnect from the FTP server use the L_InetFtpDisconnect function.

File Manipulation

The user can store files on the FTP server via L_InetFtpSendFile. To get a file from the FTP server and store it on the local system, use the function L_InetFtpGetFile. In addition, a remote file on the server can be renamed using L_InetFtpRenameFile. Finally, L_InetFtpDeleteFile can delete a remote file on the server.

Directory Manipulation

The user can create directories on the FTP server via L_InetFtpCreateDir. To delete a directory from an FTP server, use the function L_InetFtpDeleteDir. L_InetFtpChangeDir changes the working directory on the FTP server. Finally, L_InetFtpGetCurrentDir retrieves the current directory for the specified FTP session.

Directory Browsing (Search results)

Any directory can be browsed on the FTP server. In addition, a file search can also be performed. Both can be implemented by calling L_InetFtpBrowseDir. The search results can be obtained from the FTPBROWSECALLBACK. A call to this callback function is automatically generated after calling L_InetFtpBrowseDir.

Uploading a Bitmap to a ftp server

The LEADTOOLS FTP functions support uploading a LEAD bitmap. Use L_InetFtpSendBitmap function to manage asynchronous uploading of a bitmap.


Working with HTTP Internet server Functions

Working with HTTP Functions

The LEADTOOLS HTTP functions allow you to connect to Internet servers and issue requests. These functions allow you to interact with Internet servers without requiring the use of an Internet Browser.

The first step in working with an Internet server is to use L_InetHttpConnect to connect the desired Internet server. After connecting with the Internet server, designate what page, cgi script, asp script, file, or executable will be the target of the request to the Internet server. Once the target has been decided, call L_InetHttpOpenRequest to open the request to the Internet server. No data can be sent to the Internet server without first calling L_InetHttpOpenRequest.

After a valid request has been opened, several actions can be taken. Simulate a user sending a form to the server with L_InetHttpSendForm. Send raw data using L_InetHttpSendData. Finally, send a bitmap with L_InetHttpSendBitmap. If it is not necessary to send any particular data, the L_InetHttpSendRequest function can be used to send the request.

Once the request has been sent to the Internet server, the status can be retrieved using L_InetHttpGetServerStatus. If the Internet server sent, any data back in its response L_InetHttpGetResponse can be used to get the response data.

After the request is finished, call L_InetHttpCloseRequest to close the request. When no more requests are needed, call L_InetHttpDisconnect to disconnect from the Internet server.


FTP/HTTP Files To Be Included With Your Application

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation. The following subdirectory for the Internet is created:

REDIST\

Redistributable FTP/HTTP files.

Note: The FTP/HTTP features are provided for evaluation purposes only. You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license.

Note: You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS FTP/HTTP functions on a WIN32 system. (\REDIST\ subdirectory contains copies of these files.)

Please note that LTKRN is required for ALL API applications. For more information on LTKRN and other files for the Main API, refer to Files To Be Included With Your Application .

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LTWEB | FTP/HTTP support. LTWEB14N.DLL is the LEADTOOLS FTP/HTTP Support DLL. It contains support for the HTTP and FTP functions. The header file is LTWEB.H. Also requires LTFIL14N.DLL. | DLL: LTWEB14N.DLL Library: LTWEB_N.LIB. | DLL: LTWEB14NU.DLL Library: LTWEB_NU.LIB. | DLL: LTWEB14E.DLL Library: LTWEB_E.LIB. | DLL: LTWEB14EU.DLL Library: LTWEB_EU.LIB.


Installation Directory

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation.

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

The following is a list of the subdirectories in the root directory:

ACROBAT | LEADTOOLS manuals in the PDF format, which you can view and print using Adobe Acrobat. These files are optional and are available when installing from the CD-ROM.
BIN | Executable files for the demonstration programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
EXAMPLES\DLL | One subdirectory for each example API program.
EXAMPLES\OCX | One subdirectory for each example ActiveX program.
EXAMPLES\COM | One subdirectory for each example COM program.
EXAMPLES\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
INCLUDE\CLASSLIB | Header files for the Class Library
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.


Technical Support

As a registered user, free technical support is available. You must register your software to receive any technical support. Technical support is available 9 a.m. through 6 p.m. Eastern Standard Time. If you are calling by phone, please be at your computer. You can also contact us through the following methods:

Phone: | (704) 372-9681
E-mail: | support@leadtools.com
FAX: | (704) 372-8161
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Attn: Technical Support
1201 Greenwood Cliff, Suite 400
Charlotte, NC 28204

Before calling technical support, please look in the online documentation and the example programs for an answer to your question.


LEADTOOLS FTP/HTTP API Function Groups

HTTP Functions

HTTP Connections

Sending Data Over an HTTP Connection

FTP Functions

FTP Connections

File Manipulation and Sending Bitmaps Over an FTP Connection

Directory Manipulation Over an FTP Connection

Callback


HTTP Functions:HTTP Connections

HTTP Functions:
HTTP Connections

L_InetHttpConnect

L_InetHttpDisconnect

L_InetHttpOpenRequest

L_InetHttpCloseRequest

L_InetHttpGetResponse

L_InetHttpGetServerStatus


HTTP Functions:Sending Data Over an HTTP Connection

HTTP Functions:
Sending Data Over an HTTP Connection

L_InetHttpSendBitmap

L_InetHttpSendData

L_InetHttpSendForm

L_InetHttpSendRequest


FTP Functions:FTP Connections

FTP Functions:
FTP Connections

L_InetFtpConnect

L_InetFtpDisConnect


FTP Functions:File Manipulation and Sending Bitmaps Over an FTP Connection

FTP Functions:
File Manipulation and Sending Bitmaps Over an FTP Connection

L_InetFtpSendFile

L_InetFtpGetFile

L_InetFtpDeleteFile

L_InetFtpRenameFile

L_InetFtpSendBitmap


FTP Functions:Directory Manipulation Over an FTP Connection

FTP Functions:
Directory Manipulation Over an FTP Connection

L_InetFtpCreateDir

L_InetFtpDeleteDir

L_InetFtpGetCurrentDir

L_InetFtpBrowseDir

L_InetFtpChangeDir


FTP Functions: Callback

FTP Functions:
Callback

FTPBROWSECALLBACK


Data Types

Basic Data Types and Keywords

LEADTOOLS Basic Data Types

Keywords Used in Declarations

Internet Structures

FILEDATA

NAMEVALUE

L_FILETIME

HFTP

HINET


LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

Data Type | Definition and Usage
L_BITFIELD | Defined as L_UINT; used as a bit field.
L_BOOL | Defined as L_UINT; used as a boolean value.
L_CHAR | Defined as char; used as a signed 8-bit integer.
L_DOUBLE | Defined as double; used as a double precision floating point number.
L_FLOAT | Defined as float; used as a floating point number.
L_INT | Defined as int; used as a signed integer, 16-bits or larger.
L_INT16 | Defined as short; used as a signed 16-bit integer.
L_INT32 | Defined as long; used as a signed 32-bit integer.
L_UCHAR | Defined as unsigned char; used as an unsigned 8-bit integer.
L_UINT | Defined as unsigned; used as an unsigned integer, 16-bits or larger.
L_UINT16 | Defined as unsigned short; used as an unsigned 16-bit integer.
L_UINT32 | Defined as unsigned long; used as an unsigned 32-bit integer.
L_VOID | Defined as void; used as a void.
L_COMP | Defined as L_UINT; used as a handle to a computer
L_MEDIA | Defined as L_VOID L_FAR *; used as a void pointer
L_TCHAR | Defined as either char or TCHAR. If FOR_UNICODE is defined, then L_TCHAR will be defined as TCHAR.


Keywords Used in Declarations

LEADTOOLS uses the following keywords in declarations of functions, structures, and data types:

Keyword | Definition and Usage
L_FAR | Defined as nothing; used as a placeholder.
L_HUGE | Defined as nothing; used as a placeholder.
L_EXPORT | Defined as nothing; used as a placeholder.
L_PASCAL | Defined as nothing; used as a placeholder.
EXT_FUNCTION | Defined as WINAPI; used as an attribute for all toolkit functions.
pEXT_FUNCTION | Defined as EXT_FUNCTION L_FAR *; used as an attribute when defining pointers to toolkit functions.
EXT_CALLBACK | Defined as _cdecl L_FAR; used as an attribute for all toolkit callback functions.
pEXT_CALLBACK | Defined as EXT_CALLBACK L_FAR *; used as an attribute when defining pointers to toolkit callback functions.


FILEDATA

typedef struct tagFILEDATA
{
L_UINT uFileAttributes;
L_FILETIME ftCreationTime;
L_FILETIME ftLastAccessTime;
L_FILETIME ftLastWriteTime;
L_UINT32 uFileSize;
} FILEDATA, L_FAR
 *pFILEDATA;

The FILEDATA structure contains extra information about the file that was found.

Parameter | Description
uFileAttributes | Specifies the file attributes of the file that was found. Possible values are:
 | Value | Meaning
 | FTP_FILE_ATTRIBUTE_ARCHIVE | The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal.
 | FTP_FILE_ATTRIBUTE_COMPRESSED | The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories.
 | FTP_FILE_ATTRIBUTE_DIRECTORY | The handle identifies a directory.
 | FTP_FILE_ATTRIBUTE_ENCRYPTED | The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories.
 | FTP_FILE_ATTRIBUTE_HIDDEN | The file or directory is hidden. It is not included in an ordinary directory listing.
 | FTP_FILE_ATTRIBUTENORMAL | The file or directory has no other attributes set. This attribute is valid only if used alone.
 | FTP_FILE_ATTRIBUTE_OFFLINE | The file data is not immediately available. This attribute indicates that the file data has been physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software in Windows 2000. Applications should not arbitrarily change this attribute.
 | FTP_FILE_ATTRIBUTE_READONLY | The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it.
 | FTP_FILE_ATTRIBUTE_REPARSE_POINT | The file has an associated reparse point.
 | FTP_FILE_ATTRIBUTE_SPARSE_FILE | The file is a sparse file.
 | FTP_FILE_ATTRIBUTE_SYSTEM | The file or directory is part of the operating system or is used exclusively by the operating system.
 | FTP_FILE_ATTRIBUTE_TEMPORARY | The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access, rather than flushing it back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.
ftCreationTime | Specifies an L_FILETIME structure containing the time the file was created.
ftLastAccessTime | Specifies an L_FILETIME structure containing the time that the file was last accessed.
ftLastWriteTime | Specifies an L_FILETIME structure containing the time that the file was last written to.
uFileSize | Specifies the file size in bytes.


NAMEVALUE

typedef struct tagNAMEVALUE
{
L_TCHAR L_FAR *pszName;
L_TCHAR L_FAR *pszValue;
} NAMEVALUE, L_FAR *pNAMEVALUE;

The NAMEVALUE structure serves as the working structure for name items on a form. When sending a form or Bitmap it allows you to specify the HTTP form element.

Member | Description
pszName | Name of a HTTP form item.
pszValue | Value of an HTTP form item.

Comments

pNAMEVALUE is a pointer to a NAMEVALUE structure. Generally, where a function parameter type is pNAMEVALUE, you can declare a NAMEVALUE variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pNAMEVALUE variable is necessary only if your program requires a pointer.

See Also

Functions:

L_InetHttpSendBitmap,L_InetHttpSendData, L_InetHttpSendForm


L_FILETIME

The L_FILETIME structure holds an unsigned 64-bit date and time value for a file. This value represents the number of 100-nanosecond units since the beginning of January 1, 1601.

Member | Data Type | Description
dwLowDateTime | DWORD | Low-order 32 bits of the file time value.
dwHighDateTime | DWORD | High-order 32 bits of the file time value.


HFTP

LEADTOOLS has defined the following data types for referencing FTP connections:

Data Type | Description
HFTP | Handle to a global memory block.
pHFTP | Pointer to a global memory block.


HINET

LEADTOOLS has defined the following data types for referencing HTTP connection:

Data Type | Description
HINET | Handle to a global memory block.
pHINET | Pointer to a global memory block.


Return Codes

For a list of all possible return codes for LEADTOOLS FTP/HTTP API functions, refer to LEADTOOLS Main API Return Codes in the Main API.


L_InetFtpBrowseDir

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpBrowseDir(hFtp, pszSearch, pfnCallback, pData)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszSearch; | /* directory path or file name */
FTPBROWSECALLBACK pfnCallback; | /* pointer to a callback function */
L_VOID L_FAR *pData; | /* pointer to additional parameters */

Browses a specific directory or searches for a specific file on an FTP server's file system.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszSearch | Character string that contains a valid directory path or file name for the FTP server's file system. The string can contain wildcards, but no blank spaces are allowed. If the value of pszSearch is NULL or if it is an empty string, it will find the first file in the current directory on the server. This is a NULL-terminated string.
pfnCallback | Optional callback function that will receive the data found during the browse/search.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in the FTPBROWSECALLBACK Function.
pData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Searches the specified directory of the given FTP connection. File and directory entries are returned to the application in the FILEDATA structure of the callback function.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | FTPBROWSECALLBACK, L_InetFtpCreateDir, L_InetFtpChangeDir
Topics: | FTP Functions: Directory Manipulation Over an FTP Connection
 | How to Program with FTP Functions

Example

//This example connects to an ftp server and browses a directory. If found it adds files to a list.

void AddFileToList(L_TCHAR L_FAR * pszFileName, L_UINT32
 uSize)
{
// Process file data here
}

L_INT CALLBACK BrowseDirCallBack(L_TCHAR L_FAR * pszFile, pFILEDATA pFileData,
 L_VOID L_FAR * pUserData)
{
AddFileToList(pszFile, pFileData->uFileSize);
return SUCCESS;
}

L_INT CFtpTestView::BrowseFtpDir(L_TCHAR L_FAR *pszDirName, L_TCHAR L_FAR
 *pszServerName, L_TCHAR L_FAR *pszUserName, L_TCHAR L_FAR *pszPassword)
{
HFTP hFtp;
L_INT nRetCode = SUCCESS;
L_INT iPort = 21; //Deafult ftp port
nRetCode = L_InetFtpConnect
 (pszServerName, iPort, pszUserName, pszPassword, &hFtp);
if(nRetCode==SUCCESS)
L_InetFtpBrowseDir(hFtp, pszDirName
 , BrowseDirCallBack, NULL);
L_InetFtpDisConnect(hFtp);
}


L_InetFtpChangeDir

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpChangeDir(hFtp, pszDirectory)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszDirectory; | /* name of the directory */

Changes the working directory on the FTP server.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszDirectory | Character string that contains the name of the directory to change to on the remote system. This can be either a fully qualified path or a name relative to the current directory. This is a NULL-terminated string.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Changes to a different working directory on the FTP server.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpCreateDir, L_InetFtpDeleteDir, L_InetFtpGetCurrentDir
Topics: | FTP Functions: Directory Manipulation Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpConnect

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpConnect(pszServer, iPort, pszUserName, pszPassword, pFtp)

L_TCHAR L_FAR *pszServer; | /* host name of an Internet server */
L_INT iPort; | /* port on the server to connect to */
L_TCHAR L_FAR pszUserName; | /* name of the user */
L_TCHAR L_FAR *pszPassword; | /* password */
pHFTP pFtp; | /* pointer to a structure */

Establishes a connection with the specified server.

Parameter | Description
pszServer | Character string that contains the host name of an FTP server. This can be a URL, like www.leadtools.com, or it can contain the IP number of the site, in ASCII dotted-decimal format (for example, 11.0.1.45).
iPort | Number of the TCP/IP port on the server to connect to. These flags set only the port that will be used. Use the default port for FTP servers: INTERNET_DEFAULT_FTP_PORT (port 21).
pszUserName | Character string that contains the name of the user logging on. If this parameter is NULL, the function uses the default "anonymous".
pszPassword | Character string that contains the password to use when logging on. If both pszPassword and pszUsername are NULL, the function uses the default "anonymous".
pFtp | Pointer to a valid handle to the FTP connection.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpDisConnect
Topics: | FTP Functions: FTP Connections
 | How to Program with FTP Functions

Example

L_INT TransferMyFile(L_TCHAR L_FAR *pszSourceFileName, L_TCHAR
 L_FAR *pszDistFileName)
{
HFTP hFtp;
L_INT nRetCode = SUCCESS;
L_INT iPort = 21; //Default ftp port
L_TCHAR szRemoteDir[MAX_PATH];

nRetCode = L_InetFtpConnect(TEXT("ftp.Leadtools.com"),
 iPort, TEXT("User1"), TEXT("MyPassword"), &hFtp);
if(nRetCode!=SUCCESS)
return FAILURE;
L_InetFtpGetFile
 (hFtp, TEXT(" Image.bmp "), TEXT(" ftpimage.bmp "),
 TRUE, SENDAS_BINARY);

L_InetFtpRenameFile
 (hFtp, TEXT(" ImageOldName.bmp "), TEXT(" ImageNewName.bmp
 "));
L_InetFtpDeleteFile
 (hFtp, TEXT(" File1.txt"));
L_InetFtpChangeDir
 (hFtp, TEXT(" MyRootDirName "));
L_InetFtpCreateDir
 (hFtp, TEXT(" MyNewSubDirName1"));
L_InetFtpCreateDir(hFtp, TEXT(" MyNewSubDirName2"));
nRetCode = L_InetFtpSendFile
 (hFtp, pszSourceFileName, pszDistFileName, SENDAS_BINARY);
if(nRetCode!=SUCCESS)
return FAILURE;
L_InetFtpDeleteDir
 (hFtp, TEXT(" MyNewSubDirName2"));
L_InetFtpGetCurrentDir
 (hFtp, szRemoteDir, MAX_PATH);
L_InetFtpDisConnect
 (hFtp);
return SUCCESS;
}


L_InetFtpCreateDir

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpCreateDir(hFtp, pszRemoteDir)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszRemoteDir; | /* name of the directory to create */

Creates a new directory on the FTP server.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszRemoteDir | Character string that contains the name of the directory to create on the FTP server. This can be either a fully qualified path or a name relative to the current directory. This is a NULL-terminated string.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

A new directory will be created on the FTP server.

If the directory specified in pszRemoteDir already exists on the FTP server, this function will fail.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpChangeDir, L_InetFtpDeleteDir, L_InetFtpGetCurrentDir
Topics: | FTP Functions: Directory Manipulation Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpDeleteDir

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpDeleteDir(hFtp, pszRemoteDir)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszRemoteDir; | /* name of the directory to remove */

Removes the specified directory on the FTP server.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszRemoteDir | Character string that contains the name of the directory to remove on the FTP server. This can be either a fully qualified path or a name relative to the current directory. This is a NULL-terminated string.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Deletes the specified directory from the FTP server.

If the directory specified in pszRemoteDir does not exist on the FTP server, this function will fail.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpCreateDir, L_InetFtpChangeDir, L_InetFtpGetCurrentDir
Topics: | FTP Functions: Directory Manipulation Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpDeleteFile

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpDeleteFile(hFtp, pszRemote)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszRemote; | /* name of the file to delete */

Deletes a file stored on the FTP server.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszRemote | Character string that contains the name of the file to delete on the FTP server.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Removes a file stored on the FTP server.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpGetFile, InetFtpSendFile, L_InetFtpRenameFile
Topics: | FTP Functions: File Manipulation and Sending Bitmaps Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpDisConnect

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpDisConnect(hFtp)

HFTP hFtp;

/* handle to an FTP connection */

Closes a single ftp handle

Parameter | Description
hFtp | Valid HFTP handle to the FTP connection to close.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The function terminates any pending operations on the handle and discards any outstanding data.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpConnect
Topics: | FTP Functions: FTP Connections
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpGetCurrentDir

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpGetCurrentDir(hFtp, pszRemoteDir, ulSize)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszRemoteDir; | /* character string to be updated */
L_UINT32 ulSize; | /* length, in characters, of the buffer for the current directory string */

Retrieves the current directory for the specified FTP connection.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszRemoteDir | Character string to be updated with the current directory string, which specifies the absolute path to the current directory. The string is NULL-terminated. This parameter cannot be NULL.
ulSize | A variable that specifies the length, in characters, of the buffer for the current directory string. The buffer length must include room for a terminating NULL character. Using a length of MAX_PATH is sufficient for all paths.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Retrieves the current directory.

If the pszRemoteDir parameter is NULL, this function will fail.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpCreateDir, L_InetFtpChangeDir, L_InetFtpDeleteDir
Topics: | FTP Functions: Directory Manipulation Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpGetFile

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpGetFile(hFtp, pszRemote, pszLocal, bOverwrite, uSendAs)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszRemote; | /* name of the file to retrieve */
L_TCHAR L_FAR *pszLocal; | /* name of the file to create */
L_BOOL bOverwrite; | /* flag */
L_UINT uSendAs; | /* flag */

Retrieves a file from the FTP server and stores it under the specified file name, locally.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszRemote | Character string that contains the name of the file to retrieve from the FTP server. This is a NULL-terminated string.
pszLocal | Character string that contains the name of the file to create on the local system. This is a NULL-terminated string.
bOverwrite | Boolean flag that indicates whether the function should proceed if a local file of the specified name already exists. Possible values are:
 | Value | Meaning
 | TRUE | The local file will be overwritten.
 | FALSE | If the file already exists locally, then do not store the file locally.
uSendAs | Flag that indicates the conditions under which the transfers occur. Possible values are:
 | Value | Meaning
 | SENDAS_ASCII | Transfers the file as ASCII
 | SENDAS_BINARY | Transfers the file as BINARY

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Retrieves a file from the FTP server and stores it under the specified file name locally.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpSendFile, L_InetFtpRenameFile, L_InetFtpDeleteFile
Topics: | FTP Functions: File Manipulation and Sending Bitmaps Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpRenameFile

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpRenameFile(hFtp, pszOld, pszNew)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszOld; | /* current filename */
L_TCHAR L_FAR *pszNew; | /* new filename */

Renames a file stored on the FTP server.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszOld | Character string that contains the name of the file that will have its name changed on the remote FTP server. This is a NULL-terminated string.
pszNew | Character string that contains the new name for the remote file. This is a NULL-terminated string.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If the file specified in pszNew already exists, this function will fail.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpGetFile, L_InetFtpSendFile, L_InetFtpDeleteFile
Topics: | FTP Functions: File Manipulation and Sending Bitmaps Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetFtpSendBitmap

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpSendBitmap(hFtp, pBitmap, nFormat, nBitsPerPixel, nQFactor, pSaveOptions, pszRemote, uSendAs)

HFTP hFtp; | /* handle to an FTP connection */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */
L_TCHAR L_FAR *pszRemote; | /* name of the file to create on the remote system */
L_UINT uSendAs; | /* flag */

Saves a bitmap to an FTP server. The output can be in any of the supported, compressed or uncompressed, file formats.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pBitmap | Pointer to the bitmap handle referencing the bitmap that holds the image data.
nFormat | Output file format. For valid values, refer to Formats of Output Files .
nBitsPerPixel | Value indicating the resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JFIF, FILE_LEAD1JFIF, FILE_LEAD2JFIF, FILE_JTIF, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.
pszRemote | Character string that contains the name of the file to create on the remote system. This is a NULL-terminated string.
uSendAs | Flag that indicates the conditions under which the transfers occur. Possible values are:
 | Value | Meaning
 | SENDAS_ASCII | Transfers the file as ASCII
 | SENDAS_BINARY | Transfers the file as BINARY

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Saves a bitmap to the specified FTP server.

If the file specified in pszRemote already exists, this function will fail.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpSendFile
Topics: | FTP Functions: File Manipulation and Sending Bitmaps Over an FTP Connection
 | How to Program with FTP Functions

Example

L_INT TransferMyBitmap(pBITMAPHANDLE pBitmap, FILEINFO FileInfo,
 L_TCHAR L_FAR *pszFile)
{
HFTP hFtp;
L_INT nRetCode = SUCCESS;
nRetCode = L_InetFtpSendBitmap(hFtp,
 pBitmap, FILE_CMP, FileInfo.BitsPerPixel, FILE_CMP, NULL, pszFile, SENDAS_BINARY);
return nRetCode;
}


L_InetFtpSendFile

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetFtpSendFile(hFtp, pszLocal, pszRemote, uSendAs)

HFTP hFtp; | /* handle to an FTP connection */
L_TCHAR L_FAR *pszLocal; | /* name of the file to send */
L_TCHAR L_FAR *pszRemote; | /* name of the file to create on the FTP server */
L_UINT uSendAs; | /* flag that indicates the conditions under which the transfers occur */

Sends a file on the local system to the specified FTP server for storage.

Parameter | Description
hFtp | Valid HFTP handle to an FTP connection.
pszLocal | Character string that contains the name of the file to send from the local system. This is a NULL-terminated string.
pszRemote | Character string that contains the name of the file to create on the FTP server.
uSendAs | Flag that indicates the conditions under which the transfers occur. Possible values are:
 | Value | Meaning
 | SENDAS_ASCII | Transfers the file as ASCII
 | SENDAS_BINARY | Transfers the file as BINARY

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Stores a file on the FTP server.

If the file specified in pszRemote already exists, this function will fail.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpGetFile, L_InetFtpRenameFile, L_InetFtpDeleteFile
Topics: | FTP Functions: File Manipulation and Sending Bitmaps Over an FTP Connection
 | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect Example


L_InetHttpCloseRequest

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpCloseRequest(hHttp)

HINET hHttp;

/* handle to an HTTP connection*/

Closes an HTTP request that was opened with L_InetHttpOpenRequest.

Parameter | Description
hHttp | Handle to the HTTP connection on which to close the request. This is the same handle obtained using the L_InetHttpConnect function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function should be called after finishing a request.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpOpenRequest, L_InetHttpDisConnect
Topics: | HTTP Functions: HTTP Connections
 | Working with HTTP Functions

Example

For an example, refer to L_InetHttpConnect.


L_InetHttpConnect

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpConnect(pszServer, iPort, pszUserName, pszPassword, pHttp)

L_TCHAR L_FAR *pszServer; | /* name of server to connect to*/
L_INT iPort; | /* port number to connect to*/
L_TCHAR L_FAR *pszUserName; | /* username for authentication*/
L_TCHAR L_FAR *pszPassword; | /* password for authentication*/
pHINET pHttp | /* address of the variable to be updated*/

Connects to an HTTP server.

Parameter | Description
pszServer | Character string that contains the name of the server to which to connect. The name can be a network name, an IP address, or a domain name (www.leadtools.com).
iPort | Number of the port to which to connect. The default port assignment for Internet servers is 80.
pszUserName | Character string containing the username to be used for authentication.
pszPassword | Character string containing the password to be used for authentication.
pHttp | Address of the variable to be updated with the Http connection.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to establish a connection with an HTTP Server. To connect anonymously pass NULL for pszUserName and pszPassword.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpDisconnect, L_InetHttpCloseRequest
Topics: | HTTP Functions: HTTP Connections
 | Working with HTTP Functions

Example

void TestSendForm()
{
HINET hInet;
L_INT nRet;
NAMEVALUE nv[2];

nRet = L_InetHttpConnect(TEXT("www.leadtools.com"),80,TEXT(""),TEXT(""),&hInet);
if(nRet==SUCCESS)
{
nRet = L_InetHttpOpenRequest(hInet,HTTP_POST,TEXT("/form.asp"),TEXT(""),TEXT("HTTP/1.0"),0);
if(nRet==SUCCESS)
{
L_TCHAR szResponse[2048];
L_UINT32 lsize;
L_UINT uStatus;
FILE *fp;

nv[0].pszName = TEXT("email");
nv[0].pszValue =
 TEXT("myemail@somewhere.com");
nv[1].pszName = TEXT("name");
nv[1].pszValue =
 TEXT("First Last");

nRet=L_InetHttpSendForm(hInet,nv,2);
if(nRet!=SUCCESS)
{
MessageBox(NULL,
 TEXT("Error Sending Form"), TEXT("Error"),MB_ICONEXCLAMATION);
L_InetHttpCloseRequest(hInet);
L_InetHttpDisconnect(hInet);
return;
}

L_InetHttpGetServerStatus(hInet,&uStatus);
if(uStatus==L_HTTP_STATUS_OK)
{
lsize
 = 2048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("output.htm"), TEXT("wb"));
#else

fp = fopen("output.htm", "wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse
 (hInet,szResponse,&lsize);
}
fclose(fp);
}
else
MessageBox(NULL,TEXT("Problem
 With Server"), TEXT("Error"),MB_ICONEXCLAMATION);
L_InetHttpCloseRequest(hInet);
}
L_InetHttpDisconnect(hInet);
}
}

Here is a sample form.asp that can be used with this sample.

<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<BODY>
<table>
<tr>
<td>Email:</td>
<td><% Response.Write Request("Email")%></td>
</tr>
<tr>
<td>Name:</td>
<td><% Response.Write Request("Name")%></td>
</tr>
</table>
</BODY>
<HTML>


L_InetHttpDisconnect

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpDisconnect(hHttp)

HINET hHttp

/* handle to an http connection */

Disconnects the specified HTTP connection.

Parameter | Description
hHttp | Handle to the HTTP connection to disconnect. It is the same handle obtained using the L_InetHttpConnect function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to terminate a connection with an Internet server

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpConnect, L_InetHttpCloseRequest
Topics: | HTTP Functions: HTTP Connections
 | Working with HTTP Functions

Example

For an example, refer to L_InetHttpConnect.


L_InetHttpGetResponse

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpGetResponse(hHttp, pszData, ulSize)

HINET hHttp; | /* handle to an HTTP connection*/
L_CHAR L_FAR *pszData; | /* pointer to response information */
L_UINT32 L_FAR *ulSize; | /* address a variable to be updated*/

Retrieves the response from an Internet server.

Parameter | Description
hHttp | Handle to the HTTP connection. It is the same handle obtained using the L_InetHttpConnect function.
pszData | Address of the variable to be updated with the last response information from the server. Pass NULL to this parameter to update ulSize with the sizeof of buffer needed.
ulSize | Size of pszData.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The response information should be read after submitting a request to an HTTP server.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpGetServerStatus, L_InetHttpConnect
Topics: | HTTP Functions: HTTP Connections
 | Working with HTTP Functions

Example

For an example, refer to L_InetHttpConnect.


L_InetHttpGetServerStatus

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpGetServerStatus(hHttp, uStatus)

HINET hHttp; | /* handle to an HTTP connection*/
L_UINT L_FAR *uStatus; | /* address of variable to be updated*/

Gets the status of the last request sent to the HTTP server.

Parameter | Description
hHttp | Handle to the HTTP connection. This is the same handle obtained using the L_InetHttpConnect function.
uStatus | Pointer to the variable to be updated with the current status of the HTTP server. Possible values are:
 | Value | Meaning
 | L_HTTP_STATUS_OK | request completed
 | L_HTTP_STATUS_CREATED | object created, reason = new URI
 | L_HTTP_STATUS_ACCEPTED | asynchronous completion (TBS)
 | L_HTTP_STATUS_PARTIAL | partial completion
 | L_HTTP_STATUS_NO_CONTENT | no information to return
 | L_HTTP_STATUS_RESET_CONTENT | request completed, but clear form
 | L_HTTP_STATUS_PARTIAL_CONTENT | partial GET fulfilled
 | L_HTTP_STATUS_AMBIGUOUS | server couldn't decide what to return
 | L_HTTP_STATUS_MOVED | object permanently moved
 | L_HTTP_STATUS_REDIRECT | object temporarily moved
 | L_HTTP_STATUS_REDIRECT_METHOD | redirection w/ new access method
 | L_HTTP_STATUS_NOT_MODIFIED | requested resource has not been modified
 | L_HTTP_STATUS_USE_PROXY | redirection to proxy, location header specifies proxy to use
 | L_HTTP_STATUS_REDIRECT_KEEP_VERB | HTTP/1.1: keep same verb
 | L_HTTP_STATUS_BAD_REQUEST | invalid syntax
 | L_HTTP_STATUS_DENIED | access denied
 | L_HTTP_STATUS_PAYMENT_REQ | payment required
 | L_HTTP_STATUS_FORBIDDEN | request forbidden
 | L_HTTP_STATUS_NOT_FOUND | object not found
 | L_HTTP_STATUS_BAD_METHOD | method is not allowed
 | L_HTTP_STATUS_NONE_ACCEPTABLE | no response acceptable to client found
 | L_HTTP_STATUS_PROXY_AUTH_REQ | proxy authentication required
 | L_HTTP_STATUS_REQUEST_TIMEOUT | server timed out waiting for request
 | L_HTTP_STATUS_CONFLICT | user should resubmit with more info
 | L_HTTP_STATUS_GONE | the resource is no longer available
 | L_HTTP_STATUS_LENGTH_REQUIRED | the server refused to accept request w/o a length
 | L_HTTP_STATUS_PRECOND_FAILED | precondition given in request failed
 | L_HTTP_STATUS_REQUEST_TOO_LARGE | request entity was too large
 | L_HTTP_STATUS_URI_TOO_LONG | request URI too long
 | L_HTTP_STATUS_UNSUPPORTED_MEDIA | unsupported media type
 | L_HTTP_STATUS_SERVER_ERROR | internal server error
 | L_HTTP_STATUS_NOT_SUPPORTED | server does not support the functionality required to fulfill the request
 | L_HTTP_STATUS_BAD_GATEWAY | error response received from gateway
 | L_HTTP_STATUS_SERVICE_UNAVAIL | temporarily overloaded
 | L_HTTP_STATUS_GATEWAY_TIMEOUT | timed out waiting for gateway
 | L_HTTP_STATUS_VERSION_NOT_SUP | HTTP version not supported

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpConnect, L_InetHttpDisconnect, L_InetHttpOpenRequest, L_InetHttpCloseRequest.
Topics: | HTTP Functions: HTTP Connections
 | Working with HTTP Functions

Example

For an example, refer to L_InetHttpConnect.


L_InetHttpOpenRequest

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpOpenRequest(hHttp, uType, pszTarget, pszReferer, pszVersion, dwFlags)

HINET hHttp; | /* handle to an HTTP connection*/
L_UINT uType; | /* type of request*/
L_TCHAR L_FAR *pszTarget; | /* the target of the request*/
L_TCHAR L_FAR *pszReferer; | /* address of URL that initiated the request*/
L_TCHAR L_FAR *pszVersion; | /* HTTP version*/
L_UINT32 dwFlags; | /* request flags*/

Creates a new HTTP request to be sent to the server.

Parameter | Description
hHttp | Handle to the HTTP connection. It is the same handle obtained using the L_InetHttpConnect function.
uType | Specifies the type of request. Possible values are:
 | Value | Meaning
 | HTTP_GET | Send an HTTP-GET Request
 | HTTP_POST | Send an HTTP-PUT Request
pszTarget | Character string that contains the name of the file, executable module or search specifier to get or post.
pszReferer | Character string that contains the name of the document on which the link is found.
pszVersion | Character string that contains the HTTP version. If this parameter is NULL, "HTTP/1.0" is used.
dwFlags | Reserved for future use. Use 0.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

An HTTP request holds a request to be sent to an HTTP server and contains all RFC822/MIME/HTTP headers to be sent as part of the request.

L_InetHttpOpenRequest must be called before calling the following functions L_InetHttpSendBitmap, L_InetHttpSendData, L_InetHttpSendForm and L_InetHttpSendRequest.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpCloseRequest, L_InetHttpConnect
Topics: | HTTP Functions: HTTP Connections
 | Working with HTTP Functions

Example

For an example, refer to L_InetHttpConnect.


L_InetHttpSendBitmap

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpSendBitmap(hHttp, pBitmap, nFormat, nBitsPerPixel, nQFactor, pszContentType, pNameValue, pSaveOptions)

HINET hHttp; | /* handle to an HTTP connection*/
pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle */
L_INT nFormat; | /* output file format*/
L_INT nBitsPerPixel; | /* output bits per pixel*/
L_INT nQFactor; | /* quality factor*/
L_TCHAR L_FAR *pszContentType; | /* HTTP content type*/
pNAMEVALUE pNameValue; | /* pointer to a structure */
pSAVEFILEOPTION pSaveOptions; | /* pointer to extended save options*/

Sends a bitmap to an HTTP server.

Parameter | Description
hHttp | Handle to an HTTP connection. It is the same handle obtained using the L_InetHttpConnect function.
pBitmap | Pointer to the bitmap handle referencing the bitmap to send. The bitmap handle can contain the actual data, but does not have to, since your callback function can supply the data. However, the bitmap handle must contain values for the following fields: Width, Height, BitsPerPixel, BytesPerLine, nColors, ViewPerspective, Order, and DitheringMethod. (The BytesPerLine value must be a multiple of four.)
nFormat | Output file format. For valid values, refer to Formats of Output Files .
nBitsPerPixel | Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files . If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format.For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JFIF, FILE_LEAD1JFIF, FILE_LEAD2JFIF, FILE_JTIF, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.For possible values, refer to Compression Quality Factors .
pszContentType | A string describing the content type. This string is usually formatted type/subtype where type is the general content category and subtype is the specific content type. For a full list of supported content types, see your Internet browser documentation or the current HTTP specification.
pNameValue | A pointer to the structure that contains the name/value pair for this image. This information is used to get the information from a script on the server machine. This name is usually some user-defined name and the value is the filename of the image.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

It is up to a script on the server side to process the data when it is received. This script is specified in the L_InetHttpOpenRequest function. The script can be any type of file that is recognized by the HTTP Server.

This function actually saves a LEADTOOLS bitmap to a file in memory, and then sends the resulting memory file to an HTTP Internet server.

Note: The LEADTOOLS Uploading component can be used in an ASP page to extract the uploaded data.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpSendData, L_InetHttpSendForm, L_InetHttpSendRequest
Topics: | HTTP Functions: Sending Data Over a HTTP Connection
 | Working with HTTP Functions

Example

void TestSendBitmap(pBITMAPHANDLE pBitmap)
{
HINET hInet;
L_INT nRet;

nRet = L_InetHttpConnect(TEXT("www.leadtools.com"),80,TEXT(""),TEXT(""),&hInet);
if(nRet==SUCCESS)
{
nRet = L_InetHttpOpenRequest(hInet,HTTP_GET,TEXT("/upload.asp"),TEXT(""),
 TEXT("HTTP/1.0"),0);
if(nRet==SUCCESS)
{
L_TCHAR szResponse[2048];
L_UINT32 lsize;
L_UINT uStatus;
FILE *fp;
NAMEVALUE nv;

nv.pszName = TEXT("Photo");
nv.pszValue = TEXT("photo1.jpg");

nRet=L_InetHttpSendBitmap(hInet,pBitmap,FILE_JFIF,24,200,
 TEXT("image/jpg"),&nv,NULL);
if(nRet!=SUCCESS)
{
MessageBox(NULL,
 TEXT("Error Sending Form"), TEXT("Error"),MB_ICONEXCLAMATION);
L_InetHttpCloseRequest(hInet);
L_InetHttpDisconnect(hInet);
return;
}
L_InetHttpGetServerStatus(hInet,&uStatus);
if(uStatus==L_HTTP_STATUS_OK)
{
lsize
 = 2048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("output.htm"), TEXT("wb"));
#else

fp = fopen("output.htm","wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse
 (hInet,szResponse,&lsize);
}
fclose(fp);
}
else
{
MessageBox(NULL,
 TEXT("Problem With Server"), TEXT("Error"),MB_ICONEXCLAMATION);
lsize
 = 2048;
L_InetHttpGetResponse
 (hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("error.htm"), TEXT("wb"));
#else

fp = fopen("error.htm","wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
}
fclose(fp);
}
L_InetHttpCloseRequest(hInet);
}
L_InetHttpDisconnect(hInet);
}
}

/*The following upload.asp page can be used to get access to the upload file. Upload.asp also makes use of the LEAD Upload control.*/

<%
Set Upload = Server.CreateObject("LEAD.Upload")
Lead.EnableMethodErrors = false

set files = Upload.Upload

Upload.Save "c:\inetpub\wwwroot\"

' Process all files received
For Each File in Files
Response.Write File.Name & " = " & File.FileName & "<BR>"
Response.Write "Size = " & File.Size & "<BR>"
Response.Write "<BR><BR>"
Next
%>


L_InetHttpSendData

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpSendData(hHttp, pData, uSize, pszContentType, pNameValue)

HINET hHttp; | /* handle to an HTTP connection*/
L_CHAR L_FAR *pData; | /* pointer to the data to send*/
L_UINT32 uSize; | /* size of pData*/
L_TCHAR L_FAR *pszContentType; | /* HTTP content type*/
pNAMEVALUE pNameValue; | /* pointer to a structure */

Sends raw data to an HTTP server.

Parameter | Description
hHttp | Handle to the HTTP connection. It is the same handle obtained using the L_InetHttpConnect function.
pData | Pointer to data to send in the HTTP request.
uSize | Size of pData.
pszContentType | A string describing the content type. This string is usually formatted type/subtype where type is the general content category and subtype is the specific content type. For a full list of supported content types, see your Internet browser documentation or the current HTTP specification.
pNameValue | A pointer to the structure that contains the name/value pair for this image. This information is used to get the information from a script on the server machine. This name is usually some user-defined name and the value is the filename of the data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

It is up to a script on the server side to process the data when it is received. This script is specified in the L_InetHttpOpenRequest function. The script can be any type of file that is recognized by the HTTP Server.

Note: The LEADTOOLS Uploading component can be used in an ASP page to extract the uploaded data.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpSendBitmap, L_InetHttpSendForm, L_InetHttpSendRequest
Topics: | HTTP Functions: Sending Data Over a HTTP Connection
 | Working with HTTP Functions

Example

void TestSendData(L_CHAR L_FAR *pData, L_UINT32 uSize)
{
HINET hInet;
L_INT nRet;

nRet = L_InetHttpConnect(TEXT("www.leadtools.com"),80,
 TEXT(""),TEXT(""),&hInet);
if(nRet==SUCCESS)
{
nRet = L_InetHttpOpenRequest(hInet,HTTP_GET,
 TEXT("/upload.asp"), TEXT(""),TEXT("HTTP/1.0"),0);
if(nRet==SUCCESS)
{
L_TCHAR szResponse[2048];
L_UINT32 lsize;
L_UINT uStatus;
FILE *fp;
NAMEVALUE nv;

nv.pszName = TEXT("Data");
nv.pszValue = TEXT("data1.raw");
nRet=L_InetHttpSendData(hInet,pData,uSize,
 TEXT("image/jpg"),&nv);
if(nRet!=SUCCESS)
{
MessageBox(NULL,TEXT("Error
 Sending Form"),TEXT("Error"),MB_ICONEXCLAMATION);
L_InetHttpCloseRequest(hInet);
L_InetHttpDisconnect(hInet);
return;
}
L_InetHttpGetServerStatus(hInet,&uStatus);
if(uStatus==L_HTTP_STATUS_OK)
{
lsize
 = 2048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("output.htm"),TEXT("wb"));
#else

fp = fopen("output.htm","wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse
 (hInet,szResponse,&lsize);
}
fclose(fp);
}
else
{
MessageBox(NULL,TEXT("Problem
 With Server"),TEXT("Error"),MB_ICONEXCLAMATION);
lsize
 = 2048;
L_InetHttpGetResponse
 (hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("error.htm"),TEXT("wb"));
#else

fp = fopen("error.htm","wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
}
fclose(fp);
}
L_InetHttpCloseRequest(hInet);
}
L_InetHttpDisconnect(hInet);
}
}

The upload.asp file for the L_InetHttpSendBitmap function can also be used with this example.


L_InetHttpSendForm

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpSendForm(hHttp, pNameValue, uCount)

HINET hHttp; | /* handle to an HTTP connection*/
pNAMEVALUE pNameValue; | /* pointer to a structure */
L_UINT32 uCount | /* number of name/value pairs*/

Sends a form to an HTTP server.

Parameter | Description
hHttp | Handle to the HTTP connection. It is the same handle obtained using the L_InetHttpConnect function.
pNameValue | Pointer to an array of structures that contain the name and value pairs associated with the form. This information corresponds to the name and value you would provide if programming in HTML.
uCount | The number of name and value pairs in pNameValue.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function allows you to simulate submitting a form to an Internet browser. You do not need an Internet browser to use this function.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpSendBitmap, L_InetHttpSendData, L_InetHttpSendRequest
Topics: | HTTP Functions: Sending Data Over a HTTP Connection
 | Working with HTTP Functions

Example

For an example, refer to L_InetHttpConnect.


L_InetHttpSendRequest

#include "ltweb.h"

L_INT EXT_FUNCTION L_InetHttpSendRequest(hHttp, pszHeader,ulHeaderSize, pszOptional, ulOptionalSize)

HINET hHttp; | /* handle to an HTTP connection*/
L_TCHAR L_FAR *pszHeader; | /* pointer to header data*/
L_UINT32 ulHeaderSize; | /* sizeof the header data*/
L_TCHAR L_FAR *pszOptional; | /* optional data*/
L_UINT32 ulOptionalSize; | /* sizeof the optional data*/

Sends an HTTP request to the HTTP server.

Parameter | Description
hHttp | Handle to the HTTP connection. It is the same handle obtained using the L_InetHttpConnect function.
pszHeader | Pointer to any additional header data to be sent along with the request. This value can be NULL.
ulHeaderSize | Size of the data in pszHeader.
pszOptional | Pointer to any optional data to be sent after the HTTP header.
ulOptionalSize | Size of the data in pszOptional.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function can be used to send a request when it is not necessary to send additional data.

Required DLLs and Libraries

LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetHttpSendBitmap, L_InetHttpSendData, L_InetHttpSendForm
Topics: | HTTP Functions: Sending Data Over a HTTP Connection
 | Working with HTTP Functions

Example

void TestSendRequest()
{
HINET hInet;
L_INT nRet;

nRet = L_InetHttpConnect(TEXT("www.leadtools.com"),80,TEXT(""),TEXT(""),&hInet);
if(nRet==SUCCESS)
{
nRet = L_InetHttpOpenRequest(hInet,HTTP_GET,TEXT("/default.htm"),TEXT(""),
 TEXT("HTTP/1.0"),0);
if(nRet==SUCCESS)
{
L_TCHAR szResponse[2048];
L_UINT32 lsize;
L_UINT uStatus;
FILE *fp;

nRet=L_InetHttpSendRequest(hInet,NULL,0,NULL,0);
if(nRet!=SUCCESS)
{
MessageBox(NULL,TEXT("Error
 Sending Form"),TEXT("Error"),MB_ICONEXCLAMATION);
L_InetHttpCloseRequest(hInet);
L_InetHttpDisconnect(hInet);
return;
}

L_InetHttpGetServerStatus(hInet,&uStatus);
if(uStatus==L_HTTP_STATUS_OK)
{
lsize
 = 2048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("output.htm"),TEXT("wb"));
#else

fp = fopen("output.htm","wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
}
fclose(fp);
}
else
{
MessageBox(NULL,TEXT("Problem
 With Server"),TEXT("Error"),MB_ICONEXCLAMATION);
lsize
 = 2048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
#ifdef
 UNICODE

fp = _wfopen(TEXT("error.htm"),TEXT("wb"));
#else

fp = fopen("error.htm","wb");
#endif

            while(lsize!=0)
{
fwrite(szResponse,lsize,1,fp);
lsize
 = 1048;
L_InetHttpGetResponse(hInet,szResponse,&lsize);
}
fclose(fp);
}
L_InetHttpCloseRequest(hInet);
}
L_InetHttpDisconnect(hInet);
}
}


FTPBROWSECALLBACK

#include "ltweb.h"

L_INT EXT_FUNCTION YourFunction(*pszFile, pFileData, *pUserData)

L_TCHAR L_FAR *pszFile; | /* file name */
pFILEDATA pFileData; | /* pointer to a structure */
L_VOID L_FAR *pUserData; | /* pointer to additional parameters */

Handles the data generated by calling the L_InetFtpBrowseDir function.

Parameter | Description
pszFile | Character string that contains the file name. This is a NULL terminated string.
pFileData | Pointer to a FILEDATA structure that specifies extra information about the file that was found.
pUserData | A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.) Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This callback function receives the results of a file search or from browsing a directory.

A call to this callback function is generated when L_InetFtpBrowseDir is called.

This function must return SUCCESS in order to continue browsing a directory.

Required DLLs and Libraries

LTFIL
LTWEB

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions: | L_InetFtpBrowseDir
Topics: | How to Program with FTP Functions

Example

For an example, refer to L_InetFtpBrowseDir example.


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling L_UnlockSupport(L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling L_UnlockSupport.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. For more information, refer to the ..

Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase andWordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Document/Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements .


LEADTOOLS Documentation

LEADTOOLS Reference Manuals

LEADTOOLS provides reference manuals that contain the same information as the online help. You can print them from PDF files. Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

To print the PDF files, you must use the Adobe Acrobat Reader 3.0 or higher. You can download a copy of the Acrobat Reader from the Adobe web site (http://www.adobe.com). Note that different versions of the Acrobat Reader are available for different operating systems, but they all can read the same PDF files.


Uploading Component

An upload component is also included in this package. This component allows the programmer of ASP pages to receive files uploaded to the web server. This component not only works with the L_InetHttpSendData and L_InetHttpSendBitmap functions, but also supports uploading from any browser that supports the following HTML form attribute: enctype=multipart/form-data.


Topic Selection

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.