Uploads the image of a specified index in buffer to the HTTP server as a specified image format through HTTP PUT method.
Namespace: Dynamsoft.DotNet.TWAINAssembly: DynamicDotNetTWAIN (in DynamicDotNetTWAIN.dll) Version: 3.0.0.0 (3.0.0.0)
Syntax
| C# |
|---|
public bool HTTPUploadThroughPutEx( string strHTTPServer, short sImageIndex, string strHTTPRemoteFile, DWTImageFileFormat enumImageType ) |
| Visual Basic |
|---|
Public Function HTTPUploadThroughPutEx ( _ strHTTPServer As String, _ sImageIndex As Short, _ strHTTPRemoteFile 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.
- strHTTPRemoteFile
- Type: System..::..String
The name of the file to be created on the HTTP server. It should a relative path on the web server.
- 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
HTTPRemoteFile parameter should include the HTTP directory of the file.
Write permission of the specified directory is needed for uploading.
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. |