

    if (tempfileobj.length === 0) {
        contentsDiv.innerText = "Error: Please select at least 1 sample to export!";
        return;
    }

    var a = document.getElementById("tempfile");
    var file = null;
    try {
        let fileContent = "";
        let fileType = "application/json";

        if (jsonl) {
            // Convert to JSONL format
            fileContent = tempfileobj.map(obj => JSON.stringify(obj)).join("\n");
            fileType = "application/jsonl";
         