In the examples that I gave, you would need to make sure the field used is not an upload field, but a text field, and of course change the name to match (field_name_temp). My examples only allow you to see the available files, and then write them in the box.
Which is one of the reasons this becomes complicated...if you want it an integrated part of the form, a new field type would have to be added that could be similar to a select_single, but selecting from your images directory.
The second I gave needs to be its own page, and the first example linking to it:
if ($field_name_temp === 'pictures') {
$form .= "><a href=\"link.php\">Pictures</a>";
} else {
$form .= ">";
}
Now make a file in your dadabik directory (link.php):
<?php
if ($link = opendir('/home/username/public_html/images')) { // change the directory for your needs
while (false !== ($file = readdir($link))) {
if ($file != "." && $file != ".." && !is_dir($file)) {
echo "<a href=\"$file\">$file</a>\n<br>";
}
}
closedir($link);
}
?>