Upload af billede med beskrivelse.
HejJeg har lavet denne kode. Men af en eller anden grund får jeg en fejl 500 "Intern serverfejl". Der er et eler andet galt med siden, som jeg ikke kan se. Er der nogen der gider at kigge engang?
----------------Kode start----------------------
<!--#include virtual="../inc_menu_top.asp"-->
<BR>
<table width="60%" height="69%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td width="632" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td width="45%"> </td>
<td width="55%">></td>
</tr>
</table>
<%
'----------------------------------------------------------------------------------------
' Her starter beskrivelse
'----------------------------------------------------------------------------------------
%>
<%If request("funktion") = "beskrivelse" then%>
<p>Beskrivelse af billedet</p>
<form method="POST" name="beskrivelse" action="upload.asp?funktion=upload_beskrivelse">
<table width="56%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>Dato</td>
<td><input type="text" name="dato" value="<% Response.Write FormatDateTime(Now, vbLongDate) %>"></td>
</tr><tr>
<td>Titel på billed:</td>
<td><input type="text" name="titel"></td>
</tr>
<tr>
<td>Beskrivelse: </td>
<td><textarea name="descr"></textarea></td>
</tr>
<tr>
<td>Søgeord: </td>
<td><input type="text" name="words"></td>
</tr>
<tr>
<td>Kategori: </td>
<td><input type="text" name="categori"></td>
</tr>
<tr>
<td>Filnavn: </td>
<td><input type="text" name="imagename" value"=<% request.form("File1")%>> <a href="upload.asp?funktion=upload_billede">Upload stort billede her</a></td>
</tr>
</table>
<p>Husk at uploade thumbnail billedet i 50 x 50 .jpg format. Thumbnail biledet skal have præcis samme navn som det store billede.</p>
<p><a href="upload.asp?funktion=upload_thumb">Upload Thumbnail billede her</a><br>
<input type="submit">
</p>
</form>
<%
'----------------------------------------------------------------------------------------
' Her slutter beskrivelse
'----------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------
' Her starter upload af beskrivelsen
'----------------------------------------------------------------------------------------
<%If request("funktion") = "upload_beskrivelse" then%>
<%
dato = request.Form("dato")
titel = request.form("titel")
descr = request.form("descr")
words = request.form("words")
categori = request.form("categori")
imagename = request.form("imagename")
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("../../database/photoalbum.mdb")
Conn.Open DSN
strSQL = "Insert into photoalbum ("
strSQL = strSQL & "dato, "
strSQL = strSQL & "title, "
strSQL = strSQL & "description, "
strSQL = strSQL & "words, "
strSQL = strSQL & "category, "
strSQL = strSQL & "imagename) "
strSQL = strSQL & "values( "
strSQL = strSQL & "'" & dato & "', "
strSQL = strSQL & "'" & titel & "', "
strSQL = strSQL & "'" & descr & "', "
strSQL = strSQL & "'" & words & "', "
strSQL = strSQL & "'" & categori & "', "
strSQL = strSQL & "'" & imagename & "') "
Conn.Execute(strSQL)
Conn.Close
Set Conn = Nothing
response.Redirect("upload.asp?funktion=beskrivelse")
'----------------------------------------------------------------------------------------
' Her slutter upload af beskrivelsen
'----------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------
' Her starter upload af stort billede
'----------------------------------------------------------------------------------------
%>
<%If request("funktion") = "upload_billede" then%>
Upload stort billede.<br>
<p>Bemærk at det kan tage noget tid, så tryk kun på knappen en gang.</p>
<FORM METHOD="POST" ACTION="upload.asp?funktion=upload" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>
<%End if
'----------------------------------------------------------------------------------------
' Her slutter upload af stort billede
'----------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------
' Her uploades et nyt stort billede
'----------------------------------------------------------------------------------------
If request("funktion") = "upload" then
Server.ScriptTimeout = 600
' Variables
' *********
Dim mySmartUpload
Dim intCount
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/photoalbum/image")
' sample with a physical path
' intCount = mySmartUpload.Save("/d:/web/bojko.dk/www/photoalbum/image/")
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.")
end if
Response.Redirect("upload.asp?funktion=beskrivelse")
'----------------------------------------------------------------------------------------
' Her slutter upload af et nyt stort billede
'----------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------
' Her starter upload af Thumbnail billede
'----------------------------------------------------------------------------------------
%>
<%If request("funktion") = "upload_thumb" then%>
Upload thumbnail billede.<br>
<p>Bemærk at det kan tage noget tid, så tryk kun på knappen en gang.</p>
<FORM METHOD="POST" ACTION="upload.asp?funktion=upload_th" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>
<%End if
'----------------------------------------------------------------------------------------
' Her slutter upload af thumbnail billede
'----------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------
' Her uploades et nyt thumbnail billede
'----------------------------------------------------------------------------------------
If request("funktion") = "upload_th" then
Server.ScriptTimeout = 600
' Variables
' *********
Dim mySmartUpload
Dim intCount
' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/photoalbum/thumbs")
' sample with a physical path
' intCount = mySmartUpload.Save("/d:/web/bojko.dk/www/photoalbum/thumbs/")
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.")
end if
Response.Redirect("upload.asp?funktion=beskrivelse")
'----------------------------------------------------------------------------------------
' Her slutter upload af et nyt stort billede
'----------------------------------------------------------------------------------------
%>
</td>
</tr>
</table>
<BR>
<!--#include virtual="../inc_bot.asp"-->
----------------Kode slut----------------------