11. januar 2002 - 09:24
#3
Der er her:
<%
\' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
\' create the list of parameters which should not be maintained
MM_removeList = \"&index=\"
If (MM_paramName <> \"\") Then MM_removeList = MM_removeList & \"&\" & MM_paramName & \"=\"
MM_keepURL=\"\":MM_keepForm=\"\":MM_keepBoth=\"\":MM_keepNone=\"\"
\' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = \"&\" & Item & \"=\"
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
\' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = \"&\" & Item & \"=\"
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
\' create the Form + URL string and remove the intial \'&\' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> \"\") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> \"\") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> \"\") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
\' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> \"\") Then
MM_joinChar = \"&\"
Else
MM_joinChar = \"\"
End If
End Function
%>
<HTML><HEAD>
<TITLE>upload billede</TITLE>
<script language=\"JavaScript\">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName==\"Netscape\")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf(\"?\"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v==\'show\')?\'visible\':(v=\'hide\')?\'hidden\':v; }
obj.visibility=v; }
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors=\'\',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!=\"\") {
if (test.indexOf(\'isEmail\')!=-1) { p=val.indexOf(\'@\');
if (p<1 || p==(val.length-1)) errors+=\'- \'+nm+\' must contain an e-mail address.\\n\';
} else if (test!=\'R\') {
if (isNaN(val)) errors+=\'- \'+nm+\' must contain a number.\\n\';
if (test.indexOf(\'inRange\') != -1) { p=test.indexOf(\':\');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+=\'- \'+nm+\' must contain a number between \'+min+\' and \'+max+\'.\\n\';
} } } else if (test.charAt(0) == \'R\') errors += \'- \'+nm+\' der skal angives en fil.\\n\'; }
} if (errors) alert(\'Følgende fejl opstod:\\n\'+errors);
document.MM_returnValue = (errors == \'\');
}
//-->
</script>
</HEAD>
<body>
<div id=\"Layer1\" style=\"position:absolute; left:0px; top:0px; width:400px; height:100px; z-index:1; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000; overflow: hidden; visibility: hidden\"><font face=\"Georgia, Times New Roman, Times, serif\">filen
uploades... <br>
NB: ved fileupload kan der godt gå lidt tid!<br>
<br>
Hvis du glemte at angive et filnavn, så tryk <a href=\"upl1.asp\">her</a>!
</font></div>
<form enctype=\"multipart/form-data\" method=\"post\" action=\"upl2.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL)%>\" onSubmit=\"MM_validateForm(\'FILE1\',\'\',\'R\');MM_showHideLayers(\'Layer1\',\'\',\'show\');return document.MM_returnValue\">
<TABLE WIDTH=\"100%\">
<TR>
<TD ALIGN=\"RIGHT\" VALIGN=\"TOP\"><b><font face=\"Verdana, Arial, Helvetica, sans-serif\">Filnavn:</font></b></TD>
<TD ALIGN=\"LEFT\"> <font face=\"Verdana, Arial, Helvetica, sans-serif\">
<INPUT TYPE=\"FILE\" NAME=\"FILE1\">
</font></TD>
</TR>
<TR>
<TD ALIGN=\"RIGHT\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"></font></TD>
<TD ALIGN=\"LEFT\"> <font face=\"Verdana, Arial, Helvetica, sans-serif\">
<INPUT TYPE=\"SUBMIT\" NAME=\"SUB1\" VALUE=\"Upload File\">
</font></TD>
</TR>
<TR>
<TD ALIGN=\"RIGHT\"><font face=\"Verdana, Arial, Helvetica, sans-serif\"></font></TD>
<TD ALIGN=\"LEFT\"> <font face=\"Verdana, Arial, Helvetica, sans-serif\">
</font></TD>
</TR>
</TABLE>
</form>
</BODY></HTML>