SearchIndexClient.UploadKnowledgeSourceFile Method

Definition

Overloads

Name Description
UploadKnowledgeSourceFile(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.
UploadKnowledgeSourceFile(String, String, BinaryData, CancellationToken)

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

UploadKnowledgeSourceFile(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 Azure.Response UploadKnowledgeSourceFile(string sourceName, string contentDisposition, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member UploadKnowledgeSourceFile : string * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.UploadKnowledgeSourceFile : string * string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function UploadKnowledgeSourceFile (sourceName As String, contentDisposition As String, content As RequestContent, Optional context As RequestContext = Nothing) As 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="<filename>". 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

UploadKnowledgeSourceFile(String, String, BinaryData, CancellationToken)

Source:
SearchIndexClient.cs

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

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