IAPI::HttpServerFileUpload

property HttpServerFileUpload.

Opens a file and uploads its contents through Http to an instance of HttpServer v1.8.0.0 or beyond (under Windows)
or to an instance of application IPCopy for Android v15.9 or beyond (under Android). These both http servers can be
polled by an URL ended with command whois? which return runtime information from within any Web browser:

 

Under Windows:
http://localhost:51000/whois?

 

( .NET 4.5 | HttpServer - v1.9.0.0 )

 . Today is: 09/06/2019

 . Global Used RAM: 32% over 2096696 KBytes

 . Own used RAM: 11464 KBytes (aka 0.54%) - 14:25:26

 . Active connections : 1

 . Total of connections : 972

 . Total inbound  data  : 0 KBytes

 . Total outbound data  : 106 KBytes

 . Download resume : |StreamResume=offset

 

 . Threads: 18 | Handles: 348

+ Counter of methods and properties calls: [count] (id) <method>(time)

 . [1] (29) CreateTaskQueueObject(0 ms)

 . [1] (30) AddTask(0 ms)

 . [1] (53) AppRegister(0 ms)

 . [3] (56) ConvertStringToBSTR(0 ms)

 . [966] (110) WriteLogFile(0 ms)

 . [16] (113) ProbeMemoryStatus(0 ms)

 . [1] (146) AppAutoRestart(0 ms)

 ___ Used methods: 7/247, aka 2.68% of coverage

 

+ Counter of events calls (callback): [count] (id) <method>(time)

 . [1] (4) onRun(0 ms)

 ___ Used events: 1/13, aka 4.67% of coverage

 

+ Shared folders :

C:\Users

C:\Users\Public

C:\Users\Public\API

C:\APIDev\Release\WebFolder

 

Under Android:
http://localhost:51000/whois?

 

Http Server v16.7

Started at: 09/06/2019 - 14:21:37

Current Date and Time: 09/06/2019 - 14:23:41

Income Http Connections: 1/18

Receiving buffer size : 4096 KBytes

Sending buffer size   : 512 KBytes

Total inbound  data   : 0 KBytes

Total outbound data   : 12 KBytes

 

Used RAM: 104516 KBytes

Active threads: 35

Opened handles: 0

 

Android 9 | Screen: 2030 x 1080

Manufacturer: Xiaomi | Model: Redmi Note 5

Free internal storage: 25.91/50.44 GB

Free RAM: 1.51/4.00 GB

Battery Temperature: 29.0 °C

Public IP: 87.88.165.149

MAC Address: 20:47:DA:06:26:AD

Shared folder(s):

 /storage/emulated/0/Download

 /storage/emulated/0/ScriptEZ.API

 

When uploading a file, this property will display a small dialog with number of bytes and in progress percentage.

Moreover uploaded files are copied into a subdirectory named WebFolder, beneath the HttpServer executable path.
(HttpServer is a simple Windows application which can run and be reached from within LAN or Internet)

Under Android system, the folder Download will be used if no external writable SD Card is not installed on the device,
otherwise the folder will be in the following path: SDCard/Android/data/com.eci.ipcopy/files

 

(!) Note that you can use interactively the utility HttpServerFileupload.exe to upload files to these both Http Servers.

 

HRESULT HttpServerFileUpload(
            BSTR httpPath,
            BSTR FileName,
            long *pVal
);

Parameters

httpPath

[in] .   URL or IP of the Web site. (e.g "http://okay.freeboxos.fr" or "http://82.243.254.10:8080")

FileName

[in] .   Fullpath filename from local medium or HDD (e.g "D:\My Documents\BigZippedData.zip")

         (Note that appending "|sim" to the filename will just simulate uploading with only bandwidth displaying)

pVal

[out, retval]  The returned value is the number of taken seconds to upload the file or

                    0 if the file already exists within the remote http server's web folders or

                   -1 if failed: this means that the remote http server is not an HttpServer instance

Return Values

S_OK

The operation was successfull.

E_POINTER

A NULL pointer was supplied as an argument.

E_UNEXPECTED

An unexpected error occoured.

See Also

IAPI