I've been trying to write a plugin to upload photos on the post write page. I've been trying to use wp_handle_upload to handle the image uploading but I'm always getting "Specified file failed upload test." which means the tmp files don't match. Yet, the file still uploads to the upload dir, just that it throws an error which causes the plugin to exit.
Anyone know of a solution?