I recently migrated several Nubuilder instances.
The previous version was on Mariadb, the new one is on Google cloud sql
Version info of the new version:
db version: V.4.5-2024.06.09.00
file version: V.4.5-2024.06.08.10
mysql version: 8.0
php verion: 8.1
os : Debian12
Further config info: see below.
The problem I’m facing is that I cannot download/open files.
When initially clicking on the file, nothing happens.
When I checkmark the file, then uncheck it, the the file appears in bold. Then when clicking
it again I can download it.
I have made a video of this, I hope this helps:
(the opening of the file in the end is not shown on the video for some reason)
uploading files works just fine, so I think it is not a permission -issue.
I appreciate any advise on this.
Greetings, j.
config info:
Code: Select all
// ** Configuration: Modify if necessary
// *****************************************
var uploadFolder = 'libs/upload/documents/';
var idFileName = 'bl_name';
var idFileId = 'bl_files_id';
var idSubForm = 'sample_files';
// *****************************************
var idRowFileName;
var idRowFileId;
function uploadFile(event) {
var td = $(event.target);
var t = td.attr('data-nu-prefix');
idRowFileName = t + idFileName;
idRowFileId = t + idFileId;
$("#fileToUpload").click();
}
function createDownloadLink(field, folder, fileId, fileName) {
$('#' + field)
.css({
"text-decoration": "underline"
})
.css('cursor', 'pointer')
.off('click')
.attr({
fileName: fileName,
fileId: fileId,
folder: folder
})
.attr('readonly', 'readonly')
.click(function (event) {
var link = $(this).attr('fileid') + '_' + $(this).attr('fileName');
// downloadFile($(this).attr('folder') + $(this).attr('fileid') + '_' + $(this).attr('fileName'), $(this).attr('fileName'));
var url = '/vrijwilligers/libs/download.php?file=' + link;
downloadFile(url);
});
}
function addDownloadLinks(subform) {
document.cookie = "uid=#USER_ID#";
var sf = nuSubformObject(subform);
var cName = sf.fields.indexOf(idFileName);
var cId = sf.fields.indexOf(idFileId);
for (var i = 0; i < sf.rows.length; i++) {
var fileId = sf.rows[i][cId];
var fileName = sf.rows[i][cName];
if (fileName !== '') {
createDownloadLink(idSubForm + nuPad3(i) + idFileName, uploadFolder, fileId, fileName);
}
}
}
function downloadFile(url) {
window.open(url, '_blank');
// var a = document.createElement("a");
// a.href = url;
// a.setAttribute("download", filename);
// document.body.appendChild(a);
// a.click();
// document.body.removeChild(a);
}
if (nuFormType() == 'edit') {
addDownloadLinks(idSubForm);
} else {
if (typeof nuStopBrowserResize == 'function') {
nuStopBrowserResize();
}
}