หน้า upload ไม่ทำงานบน ie แต่บน firefox ปกติ จะมีแนวทางแก้ยังไงดีคับ

พูดคุยแลกเปลี่ยน ปัญหา การเขียน JavaScript เครื่องมือ AJAX Web 2.0 AJAX Framework jQuery และ Node.JS รวมถึง Framework Express ของ Node.JS ทำงานฝั่ง Server

Moderator: mindphp

daddydog
PHP Newbie
PHP Newbie
โพสต์: 2
ลงทะเบียนเมื่อ: 09/11/2010 10:26 pm

หน้า upload ไม่ทำงานบน ie แต่บน firefox ปกติ จะมีแนวทางแก้ยังไงดีคับ

โพสต์ที่ยังไม่ได้อ่าน โดย daddydog »

สวัสดีครับช่วยดูโค๊ดหน้า upload file ที่ด้านล่างนี้ให้ผมหน่อยครับมันทำงานได้กับบน firefox เท่านั้น บน ie ทำงานไม่ได้เลยครับกำลังหาทางแก้อยู่ครับ ช่วยแนะนำทีครับ

โค้ด: เลือกทั้งหมด

<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000; text-align: left;"></div>
<script language="JavaScript" type="text/JavaScript">
<!--
menu_status = new Array();
<!--%foreach from=$chosen_categories item=category_id%-->
menu_status['cat_<!--%$category_id%-->'] = 'show';

<!--%/foreach%-->

function showHide(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}
//-->

</script>
<form id="member_form" name="member_form" enctype="multipart/form-data" method="post" action="">
<input type="hidden" name="do_it" value="" />
<input type="hidden" name="file_id" value="" />
  
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border" style="padding:4px; font-size: 11px;">
		<tr>
			<td class="head_td"><h1>ACCOUNT SUMMARY</h1></td>
		</tr>
		<tr>
			<td align="left" valign="top">
				Your account is currently <h3><!--%if $current_stats.days_remaining <= 0%--><span class="error">inactive</span><!--%else%-->active<!--%/if%--></h3>. <!--%if $current_stats.days_remaining <= 3%--><a href="<!--%$path%-->members/make_payment.php">Make payment</a><!--%/if%--><br>
				You have a total of <h3><!--%$total_files%--> </h3> files stored securely.<br />
				You have <h3><!--%if $current_stats.storage_remaining <= 0%--><span class="error">0</span><!--%else%--><!--%$current_stats.storage_remaining%--><!--%/if%-->Mb </h3> storage remaining.<br />
				You have <h3><!--%if $current_stats.bandwidth_remaining <= 0%--><span class="error">0</span><!--%else%--><!--%$current_stats.bandwidth_remaining%-->Mb<!--%/if%--> </h3> transfer bandwidth remaining.<br />
				<!--You have <h3><!--%if $current_stats.days_remaining <= 0%--><span class="error">0</span><!--%else%--><!--%$current_stats.days_remaining%--><!--%/if%--> </h3> days remaining. -->
			</td>
		</tr>
		
		<tr>
			<td class="head_td"><h1>UPLOAD FILES</h1></td>
		</tr>
		<tr>
			<td>
				<!--%if $current_stats.days_remaining <= 0%-->
				Your account is currently inactive. You must make a payment before you may continue using this service.<br />
				<br />
				<div align="center"><div id="btn"><a href="<!--%$path%-->members/make_payment.php">Make payment</a></div></div>
				<!--%else%-->
				<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding:0px;">
					<!--%if $upload_errors[0]%-->
					<tr>
						<td align="center" colspan="2" class="error">
							<!--%foreach from=$upload_errors item=error%--><!--%$error%--><br><!--%/foreach%-->
						</td>
					</tr>
					<tr><td height="10"></td></tr>
					<!--%/if%-->
					<tr>
						<td align="right" width="30%">Select File:&nbsp;</td>
						<td width="70%"><input type="file" name="upload_file"></td>
					</tr>
					<tr>
						<td align="right">File Description:&nbsp;</td>
						<td><input type="text" name="description" value="" size="48"/></td>
					</tr>
					<tr id="imgLoading" style="display:none;"><!--  -->
						<td align="right" colspan="2">
							<div align="center">
								<img src="../images/waiting.gif" width="32" height="32" />
							</div>
						</td>
					</tr>
					<tr><td height="10"></td></tr>
					<tr>
						<td colspan="2" align="center">
							<input type="checkbox" name="zip" value="1" class="no_border" onClick="showHide('add_password');"/> Store as password protected archive once uploaded.<br />
							<div class="hide" id="add_password">Enter Password: <input type="text" name="password" value="<!--%$password%-->"></div>
						</td>
					</tr>
					<tr>
						<td height="10">
							<input type="hidden" id="do_it" name="do_it" value="" size="48"/>	<!--  -->
							<input type="hidden" id="file_id" name="file_id" value="" size="48"/>
						</td>
					</tr>
					<tr>

						<td colspan="2" align="center"><div id="btn"><a href="#" onClick="submit_upload();">Upload</a></div></td>
						<!--
						<td colspan="2" align="center"><div id="btn"><a href="#" onClick="member_form.do_it.value='upload'; submit();">Upload</a></div></td>
						-->
					</tr>
				</table>
				<!--%/if%-->
			</td>
		</tr>
	</table>

	<br />
	<!--%if $current_stats.days_remaining > 0%-->
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border" style="padding:0px; font-size: 11px;">
		<tr>
			<td class="head_td"><h1>YOUR CURRENT FILES</h1></td>
		</tr>

		<tr><td height="10"></td></tr>
		<tr><td colspan="6" align="center">Your new links will be active for
			<select name="link_lifetime">
				<!--%html_options options=$dd_link_lifetime selected=$link_lifetime%-->
			</select>
			 days.</td>
		</tr>
		<tr>
			<td align="left">


		<table width="100%" border="0" cellpadding="0" cellspacing="2" style="padding:0px;">
			<tr class="horizontal_line"><td colspan="3" height="2"></td></tr>
			<!--%foreach from=$files item=file%-->
			<tr class="grey">
				<td width="64%" align="center"><h3>File Name</h3></td>
				<!--<td width="15%"><h3>File Description</h3></td>-->
				<td width="12%" align="center"><h3>File Size</h3></td>
				<td width="24%" align="center"><h3>Upload Date</h3></td>
			</tr>
			<tr>
				<td><a href="javascript:void(0);" onMouseOver="return overlib('<!--%$file.description%-->', CAPTION, 'Description', CAPTIONSIZE, '10px');" onMouseOut="return nd();"><!--%$file.orig_filename%--></a>
				<!--%if $file.encrypted%-->(password: <!--%$file.password%-->)<!--%/if%--></td>
				<!--<td><!--%$file.description%--></td>-->
				<td align="right"><!--%$file.file_size%-->Kb</td>
				<td align="right"><!--%$file.create_ts%--></td>
			</tr>
			<tr><td height="10"></td></tr>


			<tr><td colspan="4">
			<table width="100%" border="0" cellpadding="0" cellspacing="2" style="padding:0px;">
			<tr class="grey">
				<td width="64%" colspan="2" align="center"><h3>Secure Download Link</h3></td>
				<td width="12%" align="center"><h3>IP Address</h3></td>
				<td width="24%" align="center"><h3>Link Expiry</h3></td>
			</tr>
			<!--%if $file.links[0]%-->
			<!--%foreach from=$file.links item=link%-->
			<tr>
				<td><input type="checkbox" name="selected_links[<!--%$link.link_id%-->]" value="<!--%$link.link_id%-->" class="no_border"/></td>
				<td><!--%$path%-->getfile.php?link=<!--%$link.link%--></td>
				<td><!--%$link.ip_address%--></td>
				<td align="right"><!--%if $link.status eq 'downloaded'%--><font color="#008000">Downloaded</font><!--%else%--><!--%$link.expire_ts%--><!--%/if%--></td>
			</tr>
			<!--%/foreach%-->
			<!--%else%-->
			<tr>
				<td colspan="4"><div class="disabled">Click the "Add Link" button below to create a secure link.</div></td>
			</tr>
			<!--%/if%-->
			</table>
			</td></tr>


			<tr>
				<td colspan="6" align="center">
					<table width="50%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td><div id="btn"><a href="#" onClick="submit_add_link('<!--%$file.file_id%-->');">Add Link</a></div></td>
						<td><div id="btn"><a href="#" onClick="submit_delete_link('<!--%$file.file_id%-->');">Delete Link(s)</a></div></td>
						<td><div id="btn"><a href="#" onClick="submit_delete_file('<!--%$file.file_id%-->');">Delete File</a></div></td>
					</tr>
					</table>
				</td>
			</tr>
			<tr><td height="6"></td></tr>
			<tr class="horizontal_line"><td colspan="3" height="2"></td></tr>
			<!--%/foreach%-->
			<tr><td height="10"></td></tr>
			<tr>
				<td colspan="6">Once you have created one or more secure links for the above files, you may then copy the link
				and give it to someone that you wish to download this file. Once this desired recipient has started
				downloading the file, that link will only be accessable from the IP address that is assigned to their
				computer.
				</td>
			</tr>
			<tr><td height="10"></td></tr>
					</table>
		
		</td></tr>
			</table>
	<!--%/if%-->
	</form>
<script language="JavaScript" type="text/JavaScript">
function submit_upload(){
	if (navigator.appName == "Netscape") {
		document.getElementById('imgLoading').style.display = 'table-row';
	} else {
		document.getElementById('imgLoading').style.display = 'block';
	}
	document.getElementById('do_it').value = "upload";
	document.getElementById('member_form').submit();
}
function submit_add_link(id){
	document.getElementById('do_it').value = "add_link";
	document.getElementById('file_id').value = id;
	document.getElementById('member_form').submit();
}

function submit_delete_link(id){
	document.getElementById('do_it').value = "delete_link";
	document.getElementById('file_id').value = id;
	document.getElementById('member_form').submit();
}
function submit_delete_file(id){
	document.getElementById('do_it').value = "delete_file";
	document.getElementById('file_id').value = id;
	document.getElementById('member_form').submit();
}
</script>
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 66