forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to use multiple files with file detector
- Loading branch information
Showing
5 changed files
with
88 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Multiple 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" multiple/></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> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters