$js .= get_js_open_window(800, 500);
page(_($help_context = "Attach Documents"), false, false, "", $js);
$js .= get_js_open_window(800, 500);
page(_($help_context = "Attach Documents"), false, false, "", $js);
$fp = fopen($dir."/index.php", "w");
fwrite($fp, $index_file);
fclose($fp);
$fp = fopen($dir."/index.php", "w");
fwrite($fp, $index_file);
fclose($fp);
- $unique_name = preg_replace('/[^a-zA-Z0-9.\-_]/', '', $_POST['unique_name']);
+ $row = get_attachment($selected_id);
+ if ($row['filename'] == "")
+ exit();
+ $unique_name = $row['unique_name'];