SearchIndexClient.UploadKnowledgeSourceFileAsync Method

Definition

Overloads

Name Description
UploadKnowledgeSourceFileAsync(String, String, RequestContent, RequestContext)

[Protocol Method] Uploads a file to a File knowledge source for processing and indexing.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
UploadKnowledgeSourceFileAsync(String, String, BinaryData, CancellationToken)

Uploads a file to a File knowledge source for processing and indexing.

UploadKnowledgeSourceFileAsync(String, String, RequestContent, RequestContext)

Source:
SearchIndexClient.cs

[Protocol Method] Uploads a file to a File knowledge source for processing and indexing.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> UploadKnowledgeSourceFileAsync(string sourceName, string contentDisposition, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member UploadKnowledgeSourceFileAsync : string * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.UploadKnowledgeSourceFileAsync : string * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function UploadKnowledgeSourceFileAsync (sourceName As String, contentDisposition As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

sourceName
String

The name of the knowledge source.

contentDisposition
String

The Content-Disposition header specifying the filename of the uploaded file. Must follow the format: attachment; filename="&lt;filename&gt;". For example: attachment; filename="installation-guide.pdf".

content
RequestContent

The content to send as the body of the request.

context
RequestContext

The request options, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

sourceName, contentDisposition or content is null.

sourceName or contentDisposition is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to

UploadKnowledgeSourceFileAsync(String, String, BinaryData, CancellationToken)

Source:
SearchIndexClient.cs

Uploads a file to a File knowledge source for processing and indexing.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>> UploadKnowledgeSourceFileAsync(string sourceName, string contentDisposition, BinaryData file, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadKnowledgeSourceFileAsync : string * string * BinaryData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>>
override this.UploadKnowledgeSourceFileAsync : string * string * BinaryData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>>
Public Overridable Function UploadKnowledgeSourceFileAsync (sourceName As String, contentDisposition As String, file As BinaryData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KnowledgeSourceFile))

Parameters

sourceName
String

The name of the knowledge source.

contentDisposition
String

The Content-Disposition header specifying the filename of the uploaded file. Must follow the format: attachment; filename="&lt;filename&gt;". For example: attachment; filename="installation-guide.pdf".

file
BinaryData

The file content to upload.

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

Exceptions

sourceName, contentDisposition or file is null.

sourceName or contentDisposition is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to