So, it turned out that if the iframe exists in the DOM when the user reloads the page, it will trigger the form again, so I simply didn't add the iframe until the user clicks to send the file.
The complete code (some is only relevant to my project, but the idea is there:
function uploadHandler()
{
if ($.browser.safari || $.browser.opera || $.browser.msie)
{
setTimeout(uploadComplete, 5);
}
else
{
uploadComplete(this);
}
}
function uploadFile(e)
{
if($('.uploadFrame').length > 0)
{
uploadiFrameNode.remove();
}
n = 'f' + Math.floor(Math.random() * 99999);
uploadiFrameNode = $('<iframe class="uploadFrame invfr" src="about:blank" id="'+n+'" name="'+n+'"></iframe>');
uploadiFrameNode.load(uploadHandler);
$('body').append(uploadiFrameNode);
formNode.attr('action', _ajaxPath + "?drive=" + drive);
formNode.attr('target', n);
formNode.attr('method', 'POST');
formNode.attr('enctype', 'multipart/form-data');
formPathNode.val(tree[tree.length - 1].path);
}
function uploadComplete()
{
refresh(tree[tree.length - 1].path);
backToMenu();
fileReset();
}