Sample code for 30+ languages & platforms
JavaScript

Reassemble a Previously Split File

Demonstrates how to reassemble a previously split file.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var success = false;

var fac = new CkFileAccess();

// Any type of file may be reassembled.  It doesn't matter if it's
// a binary file or a text file.
var reassembledFilename = "hamlet2.xml";

var partPrefix = "hamlet";
var partExtension = "spl";
var srcDirPath = ".";

// Reassembles the original file from hamlet1.spl, hamlet2.spl, ...
success = fac.ReassembleFile(srcDirPath,partPrefix,partExtension,reassembledFilename);

if (success == true) {
    console.log("Success.");
}
else {
    console.log(fac.LastErrorText);
}