Uploads the image of a specified index in buffer to the HTTP server as a specified image format through HTTP POST method.
Namespace: Dynamsoft.DotNet.TWAINAssembly: DynamicDotNetTWAIN (in DynamicDotNetTWAIN.dll) Version: 3.0.0.0 (3.0.0.0)
Syntax
| C# |
|---|
public bool HTTPUploadThroughPostEx( string strHTTPServer, short sImageIndex, string strActionPage, string strFileName, DWTImageFileFormat enumImageType ) |
| Visual Basic |
|---|
Public Function HTTPUploadThroughPostEx ( _ strHTTPServer As String, _ sImageIndex As Short, _ strActionPage As String, _ strFileName As String, _ enumImageType As DWTImageFileFormat _ ) As Boolean |
Parameters
- strHTTPServer
- Type: System..::..String
The name of the HTTP server.It should be only the name of the HTTP server, without "http://" or "https://".Port number is not needed here.
- sImageIndex
- Type: System..::..Int16
Specifies the index of image in buffer. The index is 0-based.
- strActionPage
- Type: System..::..String
The specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp".
- strFileName
- Type: System..::..String
The name of the image to be uploaded.
- enumImageType
- Type: Dynamsoft.DotNet.TWAIN.Enums..::..DWTImageFileFormat
The image format of the file to be created on the HTTP server.
Return Value
True indicates success. False indicates failure.
Remarks
Dynamic .NET TWAIN processes the image format according to the value of the ImageType.
DWTImageFileFormat Allowed Values ImageType
WEBTW_BMP BMP
WEBTW_JPG JPEG
WEBTW_TIF TIFF
WEBTW_PNG PNG
WEBTW_PDF PDF
The field name of the uploaded image is RemoteFile.
IMPORTANT: Dynamic .NET TWAIN uses a special way to see if an image is uploaded and processed successfully by server. If the server returns 0 bytes, indicates success. Otherwise, indicates failure. In other words, when the uploaded image is processed successfully, the action page on the server should not return anything, even the "html".
When the uploaded file is in TIFF format, if the value of IfTiffMultiPage is true, and there's a TIFF file with the same name on the server, the newly uploaded images will be added into the existing file.
If the value of IfTiffMultiPage is false, the old file will be replaced.
If the uploaded file is in another format, and there's a file with the same name on the server, the newly uploaded file will replace the old one.
Exceptions
| Exception | Condition |
|---|---|
| Dynamsoft.DotNet.TWAIN..::..TwainException | When an error occurs and IfThrowException property is true, an exception will be thrown. When IfThrowException property is false, please check ErrorCode and ErrorString. |