codice:
<%
function replaceChars(theString)
dim charsArray(8,1)
charsArray(0,0) = "à"
charsArray(0,1) = "a"
charsArray(1,0) = "è"
charsArray(1,1) = "e"
charsArray(2,0) = "é"
charsArray(2,1) = "e"
charsArray(3,0) = "ì"
charsArray(3,1) = "i"
charsArray(4,0) = "ò"
charsArray(4,1) = "o"
charsArray(5,0) = "ù"
charsArray(5,1) = "u"
charsArray(6,0) = " "
charsArray(6,1) = "_"
charsArray(7,0) = "/"
charsArray(7,1) = "_"
charsArray(8,0) = "\"
charsArray(8,1) = "_"
for x = 0 to uBound(charsArray)
theString = replace(theString, charsArray(x,0), charsArray(x,1))
next
replaceChars = theString
end function
nomeFile = request.form("campoForm")
basePath = server.mapPath("\mdb-database")
if len(nomeFile) > 0 then
nomeFile = replaceChars(nomeFile)
set fso = server.createObject("Scripting.FileSystemObject")
set makeFile = fso.createTextFile(basePath & "\" & nomeFile & ".txt")
set makeFile = nothing
set fso = nothing
end if
%>