Hjælp til upload funktion
Jeg har fundet et upload scritp, men efter jeg har includeret det på min hjemmeside for jeg denne fejl.Active Server Pages error 'ASP 0141'
Page Command Repeated
/have/admin/uploadgfx.asp, line 1
The @ command can only be used once within the Active Server Page.
koden for upload ser således ud.
**** uploadgfx.asp ****
[Se kode uden linienumre]
1. <%@ Language="VBScript" %>
2. <% Option Explicit %>
3.
4. <!-- #INCLUDE FILE="fileupload.inc" -->
5.
6. <HTML>
7. <HEAD>
8. <TITLE>Upload uden komponent</TITLE>
9. </HEAD>
10. <BODY>
11.
12. <%
13. '*************************************
14. '**** Test af FileUpload funktion ****
15. '**** ****
16. '**** Upload .gif eller .jpg ****
17. '**** billede til mappen /upload ****
18. '*************************************
19.
20. 'Skal formen vises?
21. If Request.ServerVariables("REQUEST_METHOD") <> "POST" Then
22. %>
23. <FORM ENCTYPE="multipart/form-data" ACTION="uploadgfx.asp" METHOD="POST">
24. <P>Vælg et billede:<BR>
25. <INPUT NAME="fileupload" TYPE="file" size="20"><BR>
26. <INPUT NAME="Action" TYPE="submit" VALUE="Upload">
27. </FORM>
28. <%
29. Else
30. Dim intFileUpload, strContentType, strFilename, intFileTotalBytes
31.
32. intFileUpload = FileUpload("pic/", 20000, Array("image/gif", "image/jpeg", "image/pjpeg"), Array("gif", "jpg"), strContentType, strFilename, intFileTotalBytes)
33.
34. If intFileUpload = 0 Then
35. Response.Write "Filen " & strFilename & " blev uploaded.<BR>"
36. Response.Write "Det er en fil af typen " & strContentType & " og den fylder " & intFileTotalBytes & " bytes:<BR>"
37. Response.Write "<IMG SRC=""upload/" & strFilename & """><BR>"
38. Else
39. Response.Write "Der opstod en fejl under upload!<BR>"
40. Response.Write "Fejl nr: " & intFileUpload & "<BR>"
41. Response.Write "Filnavn: " & strFilename & "<BR>"
42. Response.Write "Filtype: " & strContentType & "<BR>"
43. Response.Write "Filstørrelse: " & intFileTotalBytes & "<BR>"
44. End If
45. End If
46. %>
47. </BODY>
48. </HTML>
mvh
Remo
