Salve amici, vorrei creare una directory e copiarci dei file e scrivo:
<% Dim newdir, objFile
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
BlnDir = FileObject.FolderExists(Server.MapPath("/public/friends/"&(customStyle.Fields.Item("M_NAME").Value)))
if blnDir = true then
response.write"La directory è stata già creata"
Set FileObject = Nothing
else
newdir = "/public/friends/"&(customStyle.Fields.Item("M_NAME").Value)
Set objFile = Server.CreateObject("Scripting.FileSystemObject")
objFile.CreateFolder Server.MapPath(newdir)
Response.Write "Directory creata"
Set FileObject = Nothing
end if
%>
<%
Dim fsoMyFile
'Creazione dell'istanza FSO.
Set fsoMyFile = CreateObject("Scripting.FileSystemObject")
'Copia un file, se esiste lo sovrascrive (True).
fsoMyFile.CopyFile Server.MapPath("/public/friends/default.asp"), Server.MapPath("/public/"&(customStyle.Fields.Item("M_NAME").Value)&"/"), True
fsoMyFile.CopyFile Server.MapPath("/public/friends/contenuti.asp"), Server.MapPath("/public/"&(customStyle.Fields.Item("M_NAME").Value)&"/"), True
fsoMyFile.CopyFile Server.MapPath("/public/friends/contenuti_dettagli.asp"), Server.MapPath("/public/"&(customStyle.Fields.Item("M_NAME").Value)&"/"), True
%>
Perchè mi crea la directory e basta senza darmi nemmeno errore?

Rispondi quotando