summaryrefslogtreecommitdiffstats
path: root/third_party/webdriver/test_data/upload.html
blob: aca398ab7434d4a3946b94e88f79b1d5b0570e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
  <title>Upload Form</title>
  <script>
    var intervalId;
    function onTick() {
      var label = document.getElementById('upload_label');
      label.innerHTML += '.';
    }

    function onUploadSubmit() {
      document.getElementById('upload_target').contentWindow.document.body.
          innerHTML = '';
      var label = document.getElementById('upload_label');
      label.innerHTML = 'Uploading "' + document.forms[0].upload.value + '"';
      label.style.display = '';
      intervalId = window.setInterval(onTick, 500);
      return true;
    }

    function onUploadDone() {
      var label = document.getElementById('upload_label');
      label.style.display = 'none';
      window.clearInterval(intervalId);
      return true;
    }
  </script>
</head>
<body>
<form action="/common/upload" method="post" name="upload_form"
      target="upload_target" enctype="multipart/form-data"
      onsubmit="onUploadSubmit();">
  <div>
    Enter a file to upload:
    <div><input id="upload" name="upload" type="file"/></div>
    <div><input id="go" type="submit" value="Go!"/></div>
  </div>
  <div id="upload_label" style="display:none"></div>
  <iframe src="" id="upload_target" name="upload_target"
          style="width:300px;height:200px">
  </iframe>
</form>
</body>
</html>