ho una serie di files in una cartella, dovrei creare una sezione che mi permette, al click su un link, di creare una cartella nel desktop del pc e copiargli n files da una cartella.
ora, in locale l'ho fatto e funziona:
perchè in locale tutto ok, e invece quando pubblico mi da un errore del tipo:codice:' Nome della nuova cartella strNewFolder = "\Backup" ' Percorso di destinazione, relativo o assoluto strPath = "C:\Documents and Settings\All Users\Desktop" Set objFso = Server.createObject("Scripting.FileSystemObject") objFso.createFolder(strPath & strNewFolder) Set objFso = Nothing 'impostiamo la cartella da cui leggere i file strPath = Server.MapPath("/cartella/") 'impostiamo ed apriamo il recordset Set RS = Server.CreateObject("ADODB.Recordset") RS.Fields.Append "name", 200, 255 ' adVarChar RS.Fields.Append "size", 3, 4 ' adInteger RS.Fields.Append "date", 7 ' adDate RS.Open 'recuperiamo i file Set FileObject = Server.CreateObject("Scripting.FileSystemObject") Set f = FileObject.GetFolder(strPath) 'memorizziamo il file nel recordset For Each f1 in f.Files RS.AddNew RS("name") = f1.Name RS("size") = Int(f1.Size/1000) If RS("size") = 0 Then RS("size") = 1 RS("date") = f1.DateCreated Next Set f = Nothing Set FileObject = Nothing 'recuperiamo le azioni di ordinamento orderby = Request.QueryString("orderby") ordertype = Request.QueryString("ordertype") sort1 = "desc" sort2 = "asc" sort3 = "asc" 'prepariamo l'istruzione di ordinamento da passare 'alla proprietà Sort, nel caso non siano state 'passate azioni di ordinamento i file saranno 'ordinato per nome crescente sort = "name ASC" If orderby <> "" Then sort = orderby If ordertype = "asc" Then sort = orderby & " ASC" ElseIf ordertype = "desc" Then sort = orderby & " DESC" End If Select Case orderby Case "name" If ordertype = "desc" Then sort1 = "asc" ElseIf ordertype = "asc" Then sort1 = "desc" End If Case "size" sort1 = "asc" If ordertype = "desc" Then sort2 = "asc" ElseIf ordertype = "asc" Then sort2 = "desc" End If Case "date" sort1 = "asc" If ordertype = "desc" Then sort3 = "asc" ElseIf ordertype = "asc" Then sort3 = "desc" End If End Select End If RS.Sort = sort RS.MoveFirst Dim fsoMyFile Set fsoMyFile = CreateObject("Scripting.FileSystemObject") Do While Not RS.EOF 'Copia un file, se esiste lo sovrascrive (True). fsoMyFile.CopyFile Server.MapPath("../../cartella/"&rs("name")), "C:\Documents and Settings\All Users\Desktop\backup\"&rs("name"), True rs.movenext loop RS.Close Set RS = Nothing
Errore di run-time di Microsoft VBScript error '800a0046'
Autorizzazione negata
/adm/documenti/backup.asp, line 28
a questa riga:
objFso.createFolder(strPath & strNewFolder)
cioè dove si crea la cartella...
grazie a chi mi aiuta..

Rispondi quotando
