Added JavaScript to automatically attach selected files.