Easy Uploading huge Files
Depending on the settings of your web server, a simple file upload does not work in case the file size exceeds a limit. In order to solve this problem, DocuWare allows to upload files in chunks.
Beginning with version 6.7 the .NET API provides a simple way to upload files independent from their size. In order to upload files, you can pass a FileInfo to one of the functions of the EasyFileUploadExtensions class. When you create a new document, you can pass index data.
In case you upload data to a basket, you do not need to pass any index data. If you are uploading to a file cabinet that is not a basket you must pass index data.
In this example you see how you can add a new document, add a new section to a document and replace the content of a section.
Upload file
C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using DocuWare.Platform.ServerClient;
using DocuWare.Services.Http;
namespace DocuWare.PlatformClientExamples
{
static partial class Examples
{
public static void EasyUploadToBasket(FileCabinet basket)
{
var document = basket.EasyUploadSingleDocument(new System.IO.FileInfo("HRS.pdf"));
var section = document.EasyUploadFile(new System.IO.FileInfo("HRS.pdf"));
section.EasyReplaceFile(new System.IO.FileInfo("Flug.pdf"));
}
public static void EasyUploadToFileCabinet(FileCabinet fc)
{
var document = fc.EasyUploadSingleDocument(
new System.IO.FileInfo("HRS.pdf"),
DocumentIndexField.Create("COMPANY", "My Company"),
DocumentIndexField.Create("SUBJECT", "Holiday hotel booking"));
var section = document.EasyUploadFile(new System.IO.FileInfo("HRS.pdf"));
section.EasyReplaceFile(new System.IO.FileInfo("Flug.pdf"));
}
}
}
Upload multiple files
Beginning with version 6.9 the .NET API provides a simple way to upload multiple files independent from their size.
C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using DocuWare.Platform.ServerClient;
using DocuWare.Services.Http;
namespace DocuWare.PlatformClientExamples
{
static partial class Examples
{
public static void EasyUploadMultipleFilesToFileCabinet(FileCabinet fc)
{
var files = new System.IO.FileInfo[] { new System.IO.FileInfo("HRS.pdf"), new System.IO.FileInfo("Flug.pdf") };
var document = fc.EasyUploadDocument(
files,
DocumentIndexField.Create("COMPANY", "My Company"),
DocumentIndexField.Create("SUBJECT", "Holiday hotel booking"));
}
}
}