Kan ikke overføre mit hidden field
Fil1.asp<FORM NAME="MyForm" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="biler_x_upload.asp">
<TABLE CELLSPACING=0 CELLPADDING=3 BORDER=1>
<TD>
<INPUT TYPE=FILE SIZE=40 NAME="FILE1"><BR>
<INPUT TYPE="HIDDEN" VALUE="<%=id%>" name="ID">
<INPUT TYPE="SUBMIT" VALUE="Upload">
</TD>
</TABLE>
</FORM>
Jeg har lavet en udskrift af <%=id%> og den indeholder i ekspemplet en værdi der hedder '2'
biler_x_upload.asp
benytter aspupload komponenten. Men uanset hvad jeg gør synes jeg at ID feltet fra fil1.asp er tomt.
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = False
On Error Resume Next
Upload.SetMaxSize 1048576 ' Limit files to 1MB
Count = Upload.Save(Server.MapPath("/images"))
%>
<HTML>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<% If Err <> 0 Then %>
<FONT SIZE=3 FACE="Arial" COLOR=#0020A0>
<H3>The following error occured while uploading:</h3>
</FONT>
<FONT SIZE=3 FACE="Arial" COLOR=#FF2020>
<h2>"<% = Err.Description %>"</h2>
</FONT>
<FONT SIZE=2 FACE="Arial" COLOR="#0020A0">
Please <A HREF="biler_view.asp">try again</A>.
</FONT>
<% Else %>
<!-- #include file="db.inc" -->
<%
bilid=request.form("id")
response.write bilid
For Each File in Upload.Files
filename = File.FileName
sql = "INSERT INTO Billeder (BilID,Link) values ('" & BILID &"','" & filename &"')"
'set rs = dbc.Execute(sql)
next
End If
Conn.Close
Set Conn = Nothing
%>
</CENTER>
</BODY>
</HTML>
Hvad går der galt?