Exemplo n.º 1
0
        public Task<UploadedFileInfo> TransmitFileAsync(RestHost host, UploadedFile file, RestFileOptions options = null)
        {
            if (options == null)
                options = new RestFileOptions();

            string url = GetUploadUrl(host.EvolutionRootUrl, file.UploadContext);
            return _proxy.TransmitFileAsync(host, url, file, options.UploadProgress,
                (request) => AdjustFileRequest(host, request, options));


        }
Exemplo n.º 2
0
 /// <summary>
 /// Uploads a file to your community site for use in later requests such as attachments(Async)
 /// </summary>
 /// <param name="file">A file defintition object</param>
 /// <param name="options">Additional optional items for this request type</param>
 /// <returns>UploadedFileInfo</returns>
 public Task<UploadedFileInfo> UploadFileAsync(UploadedFile file, RestFileOptions options = null)
 {
     return Rest.TransmitFileAsync(this, file, options);
 }
Exemplo n.º 3
0
 private void AdjustFileRequest(RestHost host, HttpWebRequest request, RestFileOptions options)
 {
     if (options != null && options.AdditionalHeaders != null)
         SetAdditionalHeaders(request, options.AdditionalHeaders);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Uploads a file to your community site for use in later requests such as attachments
 /// </summary>
 /// <param name="file">A file defintition object</param>
 /// <param name="options">Additional optional items for this request type</param>
 /// <returns>UploadedFileInfo</returns>
 public UploadedFileInfo UploadFile(UploadedFile file, RestFileOptions options = null)
 {
     return Rest.TransmitFile(this, file, options);
 }