ASP imageupload uploader ikke
jeg har undersøgt hos compusoft om de understøtter ASP-upload og det gør de, men det virker ikke som det skulle:her er koden, tand for tand:
først er der den side hvor formen er til at uploade billeder:
<%
set conn = server.CreateObject("ADODB.Connection")
conn.open = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& server.MapPath("database/db1.mdb")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadScript1.asp">
<INPUT TYPE="FILE" SIZE="40" NAME="FILE1">
<select name="side">
<%
set db = conn.execute("select * from billeder")
do while not db.eof
%>
<option value="<%=db("side")%>"><%=replace(db("side"),"_",chr(10))%></option>
<%
db.moveNext
loop
%>
</select>
<BR>
<INPUT TYPE=SUBMIT VALUE="Upload!">
</FORM>
</body>
</html>
her er UploadScript1.asp:
<HTML>
<BODY>
<%
set conn = server.CreateObject("ADODB.Connection")
conn.open = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& server.MapPath("database/db1.mdb")
%>
<%
Set Upload = Server.CreateObject("Persits.Upload")
Count = Upload.Save(server.MapPath("billeder\uploads"))
Response.Write Count & " file(s) uploaded to \billeder\uploads"
%>
Files:<BR>
<%
For Each File in Upload.Files
imagename = File.FileName
For Each Item in Upload.Form
conn.execute("UPDATE billeder SET picname='"&imagename&"' WHERE side='"&Item.Value&"'")
next
Next
%>
<a href="ret_index.asp">Tilbage</a>
</BODY>
</HTML>
og så har jeg den her, som jeg gerne vil have til at virke... men hvor skal den hen?:
<%
mitBillede = Lcase(billeder("picname"))
If (right(picname,4)=".jpg") or (right(picname,4)=".gif") then
%>
<td><img src="billeder/uploads/<%=billeder("picname")%>"></td>
<%else%>
<td> </td>
<%end if%>
for reference se: www.testmig.dk/fjand/admin.asp
- bruger: jais
- pass: lise
-brug "hjem" og se popupvinduet der kommer!