I believe you're over-complicating the issue, as the feature is already built-in the WYSIWYG editor. Follow these steps:
1. Navigate to admin/plugins
2. Browse the WYSIWYG Editor options and check both checkboxes:
Allow images to be uploaded
Allow other content to be uploaded, e.g. Flash, PDF
3. Save the settings
4. Navigate to the ask page
5. Input some text in the question content and select it
6. Click on the Link toolbar button
7. Use the Upload tab as you would with any image upload (sending it to the server) and save the link
Now you should be able to click on the link you've just created and that will fire a file download.