> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# upload_files

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/upload_files.rs#L73-L80)
pub async fn [upload\_files](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/upload-files.md#method.upload_files)( \&self, file\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, file\_data: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)>, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[UploadFilesResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Upload one or more files to KiFSUploads one or more files to KiFS. There are two methods for uploading files: load files in their entirety, or load files in parts. The latter is recommended for files of approximately 60 MB or larger.To upload files in their entirety, populate `file_names` with the file names to upload into on KiFS, and their respective byte content in `file_data`.Multiple steps are involved when uploading in multiple parts. Only one file at a time can be uploaded in this manner. A user-provided UUID is utilized to tie all the upload steps together for a given file. To upload a file in multiple parts:

<ol>
  <li>Provide the file name in `file_names`, the UUID in the multipart\_upload\_uuid key in `options`, and a multipart\_operation value of init.</li>
  <li>Upload one or more parts by providing the file name, the part data in `file_data`, the UUID, a multipart\_operation value of upload\_part, and the part number in the multipart\_upload\_part\_number. The part numbers must start at 1 and increase incrementally. Parts may not be uploaded out of order.</li>
  <li>Complete the upload by providing the file name, the UUID, and a multipart\_operation value of complete.</li>
</ol>

Multipart uploads in progress may be canceled by providing the file name, the UUID, and a multipart\_operation value of cancel. If an new upload is initialized with a different UUID for an existing upload in progress, the pre-existing upload is automatically canceled in favor of the new upload.The multipart upload must be completed for the file to be usable in KiFS. Information about multipart uploads in progress is available in `/show/files`.File data may be pre-encoded using base64 encoding. This should be indicated using the file\_encoding option, and is recommended when using JSON serialization.Each file path must reside in a top-level KiFS directory, i.e. one of the directories listed in `/show/directories`. The user must have write permission on the directory. Nested directories are permitted in file name paths. Directories are delineated with the directory separator of ‘/’. For example, given the file path ‘/a/b/c/d.txt’, ‘a’ must be a KiFS directory.These characters are allowed in file name paths: letters, numbers, spaces, the path delimiter of ‘/’, and the characters: ‘.’ ‘-’ ‘:’ ‘\[’ ‘]’ ‘(’ ‘)’ ‘#’ ‘=’.

##### Arguments

<ul>
  <li>`file_names` - An array of full file name paths to be used for the files uploaded to KiFS. File names may have any number of nested directories in their paths, but the top-level directory must be an existing KiFS directory. Each file must reside in or under a top-level directory. A full file name path cannot be larger than 1024 characters.</li>
  <li>`file_data` - File data for the files being uploaded, for the respective files in `file_names`.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/upload_files.rs#L145-L163)
pub async fn [upload\_files\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/upload-files.md#method.upload_files_with_opts)( \&self, file\_names: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html)>, file\_data: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<[ByteBuf](https://docs.kinetica.com/content/api/rust/struct.ByteBuf.md)>, options: [UploadFilesRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[UploadFilesResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Upload one or more files to KiFSUploads one or more files to KiFS. There are two methods for uploading files: load files in their entirety, or load files in parts. The latter is recommended for files of approximately 60 MB or larger.To upload files in their entirety, populate `file_names` with the file names to upload into on KiFS, and their respective byte content in `file_data`.Multiple steps are involved when uploading in multiple parts. Only one file at a time can be uploaded in this manner. A user-provided UUID is utilized to tie all the upload steps together for a given file. To upload a file in multiple parts:

<ol>
  <li>Provide the file name in `file_names`, the UUID in the multipart\_upload\_uuid key in `options`, and a multipart\_operation value of init.</li>
  <li>Upload one or more parts by providing the file name, the part data in `file_data`, the UUID, a multipart\_operation value of upload\_part, and the part number in the multipart\_upload\_part\_number. The part numbers must start at 1 and increase incrementally. Parts may not be uploaded out of order.</li>
  <li>Complete the upload by providing the file name, the UUID, and a multipart\_operation value of complete.</li>
</ol>

Multipart uploads in progress may be canceled by providing the file name, the UUID, and a multipart\_operation value of cancel. If an new upload is initialized with a different UUID for an existing upload in progress, the pre-existing upload is automatically canceled in favor of the new upload.The multipart upload must be completed for the file to be usable in KiFS. Information about multipart uploads in progress is available in `/show/files`.File data may be pre-encoded using base64 encoding. This should be indicated using the file\_encoding option, and is recommended when using JSON serialization.Each file path must reside in a top-level KiFS directory, i.e. one of the directories listed in `/show/directories`. The user must have write permission on the directory. Nested directories are permitted in file name paths. Directories are delineated with the directory separator of ‘/’. For example, given the file path ‘/a/b/c/d.txt’, ‘a’ must be a KiFS directory.These characters are allowed in file name paths: letters, numbers, spaces, the path delimiter of ‘/’, and the characters: ‘.’ ‘-’ ‘:’ ‘\[’ ‘]’ ‘(’ ‘)’ ‘#’ ‘=’.

##### Arguments

<ul>
  <li>`file_names` - An array of full file name paths to be used for the files uploaded to KiFS. File names may have any number of nested directories in their paths, but the top-level directory must be an existing KiFS directory. Each file must reside in or under a top-level directory. A full file name path cannot be larger than 1024 characters.</li>
  <li>`file_data` - File data for the files being uploaded, for the respective files in `file_names`.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/upload_files.rs#L166-L177)
pub async fn [upload\_files\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/upload-files.md#method.upload_files_raw)( \&self, request: &[UploadFilesRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[UploadFilesResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`UploadFilesRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesRequest) to the `/upload/files` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/upload_files.rs#L181-L193)
pub async fn [upload\_files\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/upload-files.md#method.upload_files_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[UploadFilesRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[UploadFilesResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`UploadFilesRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.UploadFilesRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.