Ciao ho questo script perfettamente funzionante che mi permette di ulpodare un file.
Come posso uplodare più file in una volta sola ?
Ho guardato nelle varie discussioni provando anche lo script di Baol ma mi dà errori che non capisco.
Questo è il mio script:
<%
dim targetPath, fbase, OriginalFileName, DuplicateCounter
Function newFileSystemObject()
set newFileSystemObject=Server.CreateObject("Scripting .FileSystemObject")
End Function
Function fileExists(aFileSpec)
fileExists=newFileSystemObject.fileExists(aFileSpe c)
End Function
Response.Expires = 0
targetPath = "upload/"
Set fbase = Server.CreateObject("Chili.Upload.1")
'Split Filename down to just the filename
dim strFileName, strSentence, arrWords, strOneWord, element
strSentence = fbase.SourceFileName
strSentence = Trim(strSentence)
arrWords = Split (strSentence, "\", -1, 1)
strFileName = arrWords(UBound(arrWords))
'Check for already existing file name and append extra bits
OriginalFileName = strFileName
DuplicateCounter = 0
While fileExists(Server.mapPath(targetPath) & "/" & strFileName)
DuplicateCounter = DuplicateCounter + 1
strFileName = Left(OriginalFileName, Len(OriginalFileName)-4) & "_" & DuplicateCounter & Right(OriginalFileName, 4)
Wend
fbase.SizeLimit = 1000000
fbase.SaveToFile(Server.mapPath(targetPath) & "/" & strFileName)
Response.Redirect "upload-doc-risp.asp"
%>
IL FORM:
<form method="post" action="foto-album2.asp" name="loggy">
C o g n o m e
<input type="text" name="cogn">
P a s s w o r d
<input type="Password" name="pass">
<input type="submit" value="»»">
</form>