PageSourceSearch

https://khuemyai.go.th/application/modules/rss/views/scripts/egp/js/load.js

js khuemyai.go.th collected 2026-10-05 08:37:31 UTC 2,017 bytes, 51 lines download raw bytes

1function load(id) {
2
3    $.ajax({
4        url: "/public/rss/egp/selectfile",
5        type: 'POST',
6        dataType: 'html',
7        data: { upload_form_id: id },
8        success: function (data) {
9
10            var obj = jQuery.parseJSON(data);
11
12            if (obj.length > 1) {
13                var zip = new JSZip();
14                var count = 0;
15                var zipFilename = "file_gprocurement_" + id + ".zip";
16                var file = [];
17                for (let index = 0; index < obj.length; index++) {
18                    file[index] = "/public/" + obj[index].tbl_egp_upload_path;
19                }
20                file.forEach(async function (imgURL, i) {
21                    console.log(i)
22                    var fileExt = obj[i].tbl_egp_upload_path.split(".")
23                    var filename = obj[i].tbl_egp_upload_name + '.' + fileExt[1]
24                    var image = await fetch(imgURL)
25                    var imageBlog = await image.blob()
26                    var img = zip.folder("files");
27                    img.file(filename, imageBlog, { binary: true });
28                    count++
29                    if (count == file.length) {
30                        zip.generateAsync({ type: 'blob' }).then(function (content) {
31                            saveAs(content, zipFilename);
32                        });
33                    }
34                })
35            } else {
36                var fileExt = obj[0].tbl_egp_upload_path.split(".")
37                if (fileExt[1] == 'zip') {
38                    var a = document.createElement('a');
39                    // a.href = '/public/' + obj[0].tbl_egp_upload_path;
40                    a.href = '/public/' + obj[0].tbl_egp_upload_path.replace("files_", "files_default_");
41                    a.download = obj[0].tbl_egp_upload_name + "." + fileExt[1];
42                    a.click();
43                } else {
44                    window.location.href = "/public/" + obj[0].tbl_egp_upload_path;
45                }
46
47            }
48
49        }
50    })
51}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.