Visualizzazione dei risultati da 1 a 2 su 2

Discussione: copiare file

  1. #1

    copiare file

    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?
    Digital XP - The new expression of digital art! - http://www.mimanchitu.it

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Un file ha lo / finale?
    Fatti stampare a video quello che cerchi di copiare... controlla che sia scritto correttamente.

    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.