I am trying to upload a stream with code
using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(logText)))
{
var baseFolderUri1 = sfClient.Items.GetAlias(FolderId);
var uploadRequest = new UploadSpecificationRequest
{
FileName = "TextFile.txt",
FileSize = stream.Length,
Details = "Sample details",
Parent = baseFolderUri1
};
var uploader = sfClient.GetFileUploader(uploadRequest, new PlatformFileStream(stream, stream.Length, "TextFile.txt"));
var uploadResponse = uploader.Upload();
}
Its working fine with my Console Application but I am working on a plugin type of project. I have a class library project after creating that I have to create a dll and upload it to that it's not working
getting Error -- ErrorCode: Unknown Message: FilePart upload failed
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at ShareFile.Api.Client.Transfers.Uploaders.ScalingFileUploader.Upload(Dictionary`2 transferMetadata, Nullable`1 cancellationToken)
at MorningSide.DocumentExport.Services.ShareFile.ShareFileV3.Upload(ShareFileClient sfClient, Stream fileStream, String parentFolder, String fileName)
...
using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(logText)))
{
var baseFolderUri1 = sfClient.Items.GetAlias(FolderId);
var uploadRequest = new UploadSpecificationRequest
{
FileName = "TextFile.txt",
FileSize = stream.Length,
Details = "Sample details",
Parent = baseFolderUri1
};
var uploader = sfClient.GetFileUploader(uploadRequest, new PlatformFileStream(stream, stream.Length, "TextFile.txt"));
var uploadResponse = uploader.Upload();
}
Its working fine with my Console Application but I am working on a plugin type of project. I have a class library project after creating that I have to create a dll and upload it to that it's not working
getting Error -- ErrorCode: Unknown Message: FilePart upload failed
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at ShareFile.Api.Client.Transfers.Uploaders.ScalingFileUploader.Upload(Dictionary`2 transferMetadata, Nullable`1 cancellationToken)
at MorningSide.DocumentExport.Services.ShareFile.ShareFileV3.Upload(ShareFileClient sfClient, Stream fileStream, String parentFolder, String fileName)
...
Mosin