I guess you are trying to upload this file asynchronously so:
Client side
In order to select a file you have to use inside your html:
<input type="file" id="file">
Users can select their file with this element. Now the Javascript part:
function upload() {
var formData = new FormData();
var target = //Upload-Server URL
formData.append("file", document.getElementById("file").files[0]);
var xhr = new XMLHttpRequest();
var eventSource = xhr.upload || xhr;
eventSource.addEventListener("progress", function(e){
var current = e.loaded || e.position ;
var total = e.total || e.totalSize;
var percant = parseInt((current/total)*100, 10);
// DO whatever you want with progress
});
xhr.open("POST", target, true);
xhr.send(formData);
xhr.onload = function() {
if (this.status === 200)
// SUCCESS
};
}
Client Side
I do not have experience with python server side coding but this http://webpython.codepoint.net/cgi_file_upload may be useful in your case.