I am writing a wordpress (3.51) custom plugin to store data in a series of custom tables. In the form to populate the primary table I would like to upload an image (or select one from the media library), display a preview and then store the URI in table along with the rest of the data collected in the form. Is there a straightforward way to achieve this?

Any help would be much appreciated.