4 <title>Upload Form</title>
8 var label = document.getElementById('upload_label');
9 label.innerHTML += '.';
12 function onUploadSubmit() {
13 document.getElementById('upload_target').contentWindow.document.body.
15 var label = document.getElementById('upload_label');
16 label.innerHTML = 'Uploading "' + document.forms[0].upload.value + '"';
17 label.style.display = '';
18 intervalId = window.setInterval(onTick, 500);
22 function onUploadDone() {
23 var label = document.getElementById('upload_label');
24 label.style.display = 'none';
25 window.clearInterval(intervalId);
31 <form action="/common/upload" method="post" name="upload_form"
32 target="upload_target" enctype="multipart/form-data"
33 onsubmit="onUploadSubmit();">
35 Enter a file to upload:
36 <div><input id="upload" name="upload" type="file"/></div>
37 <div><input id="go" type="submit" value="Go!"/></div>
39 <div id="upload_label" style="display:none"></div>
40 <iframe src="" id="upload_target" name="upload_target"
41 style="width:300px;height:200px">