Here\'s the new HTML:
Why not just do_upload to a temporary directory of your choosing, or /tmp, do the processing you need. If it passes, create the row and store the file into your directory.
do_upload
/tmp