Uploads the image of a specified index in buffer to the HTTP server 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 HTTPUploadThroughPost( string strHTTPServer, short sImageIndex, string strActionPage, string strFileName ) |
| Visual Basic |
|---|
Public Function HTTPUploadThroughPost ( _ strHTTPServer As String, _ sImageIndex As Short, _ strActionPage As String, _ strFileName As String _ ) 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.
Return Value
True indicates success. False indicates failure.
Remarks
Dynamic .NET TWAIN processes the image format according to the extension of the FileName.
Dynamic .NET TWAIN supports the following types of image files:
Bitmap *.bmp, *.dib
JPEG *.JPG, *.JPEG, .*.JPE, *.JFIF
TIFF *.TIF, *.TIFF
PNG *.PNG
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. |