L_InetFtpSendBitmap

#include "ltweb.h"

L_LTWEB_API L_INT 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 *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

LTWEB
LTFIL

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 InetFtpSendBitmapExample(pBITMAPHANDLE pBitmap,
                                               FILEINFO      FileInfo,
                                               L_TCHAR     * pszFile)
{
   HFTP hFtp=NULL; 
   L_INT nRetCode = SUCCESS; 
   nRetCode = L_InetFtpSendBitmap(hFtp, pBitmap, FILE_CMP, FileInfo.BitsPerPixel,
                                  FILE_CMP, NULL, pszFile, SENDAS_BINARY); 
    return nRetCode;
}