Jeg skal have lavet et system til upload af billeder til min side
således at man kan uploade sit profil billede bl.a.
(vil lige pointere at dette er første gang jeg roder med upload i
asp)
Mit script er lavet i functions og det vil altså bare ik virke.
Her er mit script:
----------------------------------------------------------------
Function uploadit()
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = True
On Error Resume Next
Upload.SetMaxSize 1048576
Count = Upload.Save("" & server.mappath & "/" &
request.querystring("folder") & "")
If Err <> 0 Then
HTMLstr = HTMLstr & "<FONT SIZE='1' FACE='verdana'
COLOR='#0020A0'>The following error occured while
uploading:</FONT><br>"
HTMLstr = HTMLstr & "<FONT SIZE='1' FACE='verdana'
COLOR='#FF2020'>" & Err.Description & "</FONT><br>"
Else
HTMLstr = HTMLstr & "<FONT SIZE='1' FACE='verdana'
COLOR='#0020A0'>"
HTMLstr = HTMLstr & "Success! Count file(s) have been uploaded."
HTMLstr = HTMLstr & "</FONT>"
HTMLstr = HTMLstr & "<FONT SIZE='1' FACE='verdana'
COLOR='#0020A0'>"
HTMLstr = HTMLstr & "<TH BGCOLOR='#FFFF00'>Uploaded File</TH><TH
BGCOLOR='#FFFF00'>Size</TH><TH BGCOLOR='#FFFF00'>Original
Size</TH><TR>"
For Each File in Upload.Files
If File.ImageType = "GIF" or File.ImageType = "JPG" or
File.ImageType = "PNG" Then
HTMLstr = HTMLstr & "<TD ALIGN='CENTER'>"
HTMLstr = HTMLstr & "<IMG SRC='" &
request.querystring("folder") & "/" & File.FileName & "'
width='405'><BR><B>" & File.OriginalPath & "</B><BR>"
HTMLstr = HTMLstr & "(" & File.ImageWidth & " x " &
File.ImageHeight & " pixels)"
HTMLstr = HTMLstr & "</TD>"
Else
HTMLstr = HTMLstr & "<TD><B>" & File.OriginalPath &
"</B></TD>"
End If
HTMLstr = HTMLstr & "<TD ALIGN='RIGHT' VALIGN='TOP'>" &
File.Size & " bytes</TD>"
HTMLstr = HTMLstr & "<TD ALIGN='RIGHT' VALIGN='TOP'>" &
File.OriginalSize & " bytes</TD><TR>"
Next
End If
uploadit = HTMLstr
End Function
----------------------------------------------------------------
Den er så sød at komme med fejlen:
The following error occured while uploading:
Wrong number of arguments or invalid property assignment
Er der nogen af jer der kan fortælle mig hvorfor den kommer med
den fejl og muligvis hjælpe mig med at få det til at virke?
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials