NodeRed
351<script type="text/javascript">
(function() {
// Get the file input and hidden input elements
var directoryInput = document.getElementById('node-config-input-directory');
var pathInput = document.getElementById('node-config-input-directory-path');
// Listen for changes on the file input
directoryInput.addEventListener('change', function(event) {
var files = event.target.files;
if (files.length > 0) {
// Get the directory path
var directoryPath = files[0].webkitRelativePath.split('/')[0];
// Store the path in the hidden input
pathInput.value = directoryPath;
}
});
})();
</script>
