ฉันพบว่าไม่มีวิธีแก้ปัญหาสำหรับส่วนประกอบแอสพัทโหลด ฉันจะเขียนโซลูชันการปรับปรุงของฉันที่นี่! ขอบคุณ
โซลูชันสำหรับส่วนประกอบอัพโหลดแอสแพ็ทโหลดการเปลี่ยนชื่อไฟล์ปัญหาแถบความคืบหน้า!
มีทั้งหมด 4 ไฟล์คือ 1.asp, 2.asp, bar.asp, framebar.asp
เรียกใช้ไฟล์แรก: 1.asp ดำเนินการอัปโหลด!
การคัดลอกรหัสมีดังนี้:
-
บาร์ความคืบหน้า
dimspid, pid, barref
SetUploadProgress = Server.CreateObject ("Persit.uploadProgress")
spid = uploadprogress.createprogressid ()
pid = "pid =" & spid
barref = "framebar.asp? ถึง = 10 &" & pid
-
<scriptLanguage = "JavaScript">
-
FunctionShowProgress ()
// การโหลดแถบความคืบหน้า
-
Strappversion = Navigator.Appversion;
if (document.upfile.filename.value! = "")
-
if (strappversion.indexof ('msie')! =-1 && strappversion.substr (strappversion.indexof ('msie')+5,1)> 4)
-
winstyle = "dialogwidth = 375px; dialogheight: 175px; center: ใช่สถานะ: ไม่";
window.showModelessDialog ('<%= barref%> & b = ie', หน้าต่าง, winstyle);
-
อื่น
-
window.open ('<%= barref%> & b = nn', '', 'ความกว้าง = 370, ความสูง = 165', จริง);
-
-
returntrue;
-
functionsispic () {
Vartemp;
varextList = ". jpg.gif.bmp.png.swf"; // ไคลเอนต์ตรวจจับชื่อไฟล์ต่อท้ายไฟล์เพื่อไม่ให้รายงานข้อผิดพลาดประเภทไฟล์หลังจากอัปโหลด!
varfilename = upfile.filename.value;
varthe_ext = filename.substr (filename.lastindexof (".")+1) .toLowerCase ();
if (extlist.indexof (the_ext) ==-1) {
การแจ้งเตือน ("ไม่ใช่รูปภาพโปรดเลือกไฟล์รูปภาพ!");
returnfalse;
-
returntrue;
-
-
</script>
<html>
<head> </head>
<body>
<formMethod = "post" enctype = "multipart/form-data" action = "2.asp? <%= pid%>" name = "upfile" onsubmit = "returnshowprogress ();">
เลือกไฟล์เพื่ออัปโหลด: <br>
<inputType = filename = "filename"> <br>
<inputType = submitValue = "อัปโหลด" onClick = "returnispic ()">
</form>
</body>