> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/files/dir_30aba3d9bf6279a25d84abe4015711f7/dir_f7a957c8f5c8e80b5a8d4b37f193d419/dir_e8da2933844aa72825eccee783cf08f3/_file_upload_8c.md).

# FileUpload.c

[Macros](#define-members) | [Functions](#func-members)

`#include <libgen.h>` `#include <zlib.h>` `#include "EventScheduler.h"` `#include "VHQConfig.h"` `#include "VHQDebug.h"` `#include "VHQDownloader.h"` `#include "VHQIo.h"` `#include "VHQIoInternals.h"` `#include "VHQSecurity.h"` `#include "../inc/VHQConfig.h"` `#include "../inc/VHQFileNames.h"` `#include "VHQPosIPC.h"` `#include "VHQUtils.h"` `#include "VHQcURLconfiguration.h"` `#include <curl/curl.h>`

Include dependency graph for FileUpload.c:

![](/files/P7qtPbhtLoAxOm0P97Fo)

|         |                                                     |
| ------- | --------------------------------------------------- |
| Macros  |                                                     |
| #define | [CHUNK](#a25022864dfc8ec428e7128282e57b136)   16384 |

|                |                                                                                                                                                                                                                                                                                                                                      |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Functions      |                                                                                                                                                                                                                                                                                                                                      |
| void           | [cleanupHandler](#a52c4a85b2a16ab733db4178eade67bbd) (void \*arg)                                                                                                                                                                                                                                                                    |
| vhq\_result\_t | [UploadFile](#aa5606dfa84fa414e17f2f5c95dfe1e6a) (upload\_method\_t eMethod, char \*pszFileName, char \*pszUser, char \*pszPw, char \*pszUrl, bool compressionEnabled, char \*ulFileName, event\_set\_id\_t event\_set\_id, event\_id\_t event\_id)                                                                                  |
| vhq\_result\_t | [UploadFileWebMethod](#a0a2e99b4c44bcc1dea07eaa6c9b50832) (const char \*pszFileName, const char \*pszUrl, const char \*pszWebMethod, char \*\*pszUploadMethodXML, const char \*ulFileName, int \*comm\_id, int \*srv\_msg\_id, char \*operation\_id, bool close\_comm\_id, event\_set\_id\_t event\_set\_id, event\_id\_t event\_id) |

### DetailedDescription <a href="#detailed-description" id="detailed-description"></a>

Upload file given to URL

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### CHUNK <a href="#a25022864dfc8ec428e7128282e57b136" id="a25022864dfc8ec428e7128282e57b136"></a>

\#define CHUNK   16384

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### cleanupHandler() <a href="#a52c4a85b2a16ab733db4178eade67bbd" id="a52c4a85b2a16ab733db4178eade67bbd"></a>

void cleanupHandler

### UploadFile() <a href="#aa5606dfa84fa414e17f2f5c95dfe1e6a" id="aa5606dfa84fa414e17f2f5c95dfe1e6a"></a>

vhq\_result\_t UploadFile

This function is wrapper function for UploadFileDirect()

**Parameters**

\[in] **eMethod** = upload method \[in] **pszFileName** = local filename \[in] **pszUser** = name of user \[in] **pszPw** = PW \[in] **pszUrl** = server URL \[in] **compressionEnabled** = TRUE, if compression enabled. \[in] **ulFileName** = upload filename \[in] **event\_set\_id** = event set id \[in] **event\_id** = event id

#### Returns

vhq\_result\_t, VHQ\_SUCCESS on success.

### UploadFileWebMethod() <a href="#a0a2e99b4c44bcc1dea07eaa6c9b50832" id="a0a2e99b4c44bcc1dea07eaa6c9b50832"></a>

vhq\_result\_t UploadFileWebMethod

This function is for uploading file process for HTTP Post transfer to the VHQ server

**Parameters**

\[in] **pszFileName** = local file name to be uploaded to server \[in] **pszUrl** = server address \[in] **pszWebMethod** = transfer method, should be web service \[in] **pszUploadMethodXML** = header information for transmission \[in] **ulFileName** = the expected file name by the server \[in] **comm\_id** = communication ID \[in] **msg\_id** = message ID \[in] **srv\_msg\_id** = server message ID \[in] **operation\_id** = operation ID \[in] **close\_comm\_id** = TRUE, if close comm\_id \[in] **event\_set\_id** = event set id of event \[in] **event\_id** = event ID of event

#### Returns

vhq\_result\_t, VHQ\_SUCCESS on success.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/files/dir_30aba3d9bf6279a25d84abe4015711f7/dir_f7a957c8f5c8e80b5a8d4b37f193d419/dir_e8da2933844aa72825eccee783cf08f3/_file_upload_8c.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
