This commit has been accessed 600 times via Git panel.
commit a9a728949fab2ba6bac8c3c6972d0febefae4fdf
tree 7dc2fd2c3c17f931568f112121ae0c0e8726b157
parent 495e22b5bfb061fca2db441bf711e09d728060d6
author Engels Antonio <engels@majcms.org> 1308596444 +0800
committer Engels Antonio <engels@majcms.org> 1308596444 +0800
Fix upload "hang" in Google Chrome
diff --git a/filedrop.php b/filedrop.php
index 28595e2..9280176 100644
--- a/filedrop.php
+++ b/filedrop.php
@@ -49,6 +49,6 @@ if (isset($_FILES['filedrop_obj']) and !empty($_FILES['filedrop_obj']) and isset
?>
<script>
-parent.document.getElementById('filedrop_wait').innerHTML = '';
-parent.document.filedrop_form.filedrop_submit.disabled=false;
+parent.top.document.getElementById('filedrop_wait').innerHTML = '';
+parent.top.document.filedrop_form.filedrop_submit.disabled=false;
</script>
diff --git a/post.php b/post.php
index b2f4034..81751d0 100644
--- a/post.php
+++ b/post.php
@@ -73,12 +73,12 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
<iframe name="filedrop" src="filedrop.php" frameborder="0" scrolling="0" width="0" height="0"></iframe>
<table border="0" cellspacing="0" cellpadding="0">
-<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop">
+<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop" onsubmit="this.elements['filedrop_submit'].disabled = true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
<tr><td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input type="hidden" name="filedrop_box" value="<?php echo $filedrop_box; ?>">
<input type="file" name="filedrop_obj">
-<input type="submit" name="filedrop_submit" value="Upload" onload="javascript:document.filedrop_form.filedrop_submit.disabled=false" onclick="javascript:document.filedrop_form.filedrop_submit.disabled=true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
+<input type="submit" name="filedrop_submit" value="Upload">
</td>
<td>
diff --git a/send.php b/send.php
index bf2bf14..7357850 100644
--- a/send.php
+++ b/send.php
@@ -232,12 +232,12 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
<iframe name="filedrop" src="filedrop.php" frameborder="0" scrolling="0" width="0" height="0"></iframe>
<table border="0" cellspacing="0" cellpadding="0">
-<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop">
+<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop" onsubmit="this.elements['filedrop_submit'].disabled = true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
<tr><td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input type="hidden" name="filedrop_box" value="<?php echo $filedrop_box; ?>">
<input type="file" name="filedrop_obj">
-<input type="submit" name="filedrop_submit" value="Upload" onload="javascript:document.filedrop_form.filedrop_submit.disabled=false" onclick="javascript:document.filedrop_form.filedrop_submit.disabled=true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
+<input type="submit" name="filedrop_submit" value="Upload">
</td>
<td>
tree 7dc2fd2c3c17f931568f112121ae0c0e8726b157
parent 495e22b5bfb061fca2db441bf711e09d728060d6
author Engels Antonio <engels@majcms.org> 1308596444 +0800
committer Engels Antonio <engels@majcms.org> 1308596444 +0800
Fix upload "hang" in Google Chrome
diff --git a/filedrop.php b/filedrop.php
index 28595e2..9280176 100644
--- a/filedrop.php
+++ b/filedrop.php
@@ -49,6 +49,6 @@ if (isset($_FILES['filedrop_obj']) and !empty($_FILES['filedrop_obj']) and isset
?>
<script>
-parent.document.getElementById('filedrop_wait').innerHTML = '';
-parent.document.filedrop_form.filedrop_submit.disabled=false;
+parent.top.document.getElementById('filedrop_wait').innerHTML = '';
+parent.top.document.filedrop_form.filedrop_submit.disabled=false;
</script>
diff --git a/post.php b/post.php
index b2f4034..81751d0 100644
--- a/post.php
+++ b/post.php
@@ -73,12 +73,12 @@ if (isset($_POST['new']) and !empty($_POST['new']) and is_numeric($_POST['new'])
<iframe name="filedrop" src="filedrop.php" frameborder="0" scrolling="0" width="0" height="0"></iframe>
<table border="0" cellspacing="0" cellpadding="0">
-<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop">
+<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop" onsubmit="this.elements['filedrop_submit'].disabled = true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
<tr><td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input type="hidden" name="filedrop_box" value="<?php echo $filedrop_box; ?>">
<input type="file" name="filedrop_obj">
-<input type="submit" name="filedrop_submit" value="Upload" onload="javascript:document.filedrop_form.filedrop_submit.disabled=false" onclick="javascript:document.filedrop_form.filedrop_submit.disabled=true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
+<input type="submit" name="filedrop_submit" value="Upload">
</td>
<td>
diff --git a/send.php b/send.php
index bf2bf14..7357850 100644
--- a/send.php
+++ b/send.php
@@ -232,12 +232,12 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
<iframe name="filedrop" src="filedrop.php" frameborder="0" scrolling="0" width="0" height="0"></iframe>
<table border="0" cellspacing="0" cellpadding="0">
-<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop">
+<form name="filedrop_form" enctype="multipart/form-data" action="filedrop.php" method="post" target="filedrop" onsubmit="this.elements['filedrop_submit'].disabled = true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
<tr><td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input type="hidden" name="filedrop_box" value="<?php echo $filedrop_box; ?>">
<input type="file" name="filedrop_obj">
-<input type="submit" name="filedrop_submit" value="Upload" onload="javascript:document.filedrop_form.filedrop_submit.disabled=false" onclick="javascript:document.filedrop_form.filedrop_submit.disabled=true;document.getElementById('filedrop_wait').innerHTML = '<img src=images/ajax-loader.gif border=0 width=16 height=16 hspace=5>';">
+<input type="submit" name="filedrop_submit" value="Upload">
</td>
<td>