ho delle pagine in cui invio dei file xls su una cartella del server e funziona,
ma quando invio lo stesso file più volte mi dice Autorizzazione negata,
se rinomino il file funziona di nuovo.
Dipende da cosa??? dalla cartella
codice:byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Dim UploadRequest Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin contentType = UploadRequest.Item("blob").Item("ContentType") filepathname = UploadRequest.Item("blob").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) value = UploadRequest.Item("blob").Item("Value") 'nome = UploadRequest.Item("c").item("value") 'nome = request.form("c") 'Create FileSytemObject Component Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") 'Create and Write to a File pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-21 '**************************************************************** '**************************************************************** 'CREO CARTELLA ' Nome della nuova cartella strNewFolder = "/" & application("mese")&"-" & application("anno") ' Percorso di destinazione, relativo o assoluto strPath = Server.MapPath("\elencofile\") Set objFso = Server.CreateObject("Scripting.FileSystemObject") If objFso.FolderExists (strPath & strnewfolder) Then ' Response.Write "La directory esiste." Else 'se non esiste la creo recuperando in nome dell'id objFso.CreateFolder(strPath & strNewFolder) End If Set objFso = Nothing Set MyFile = ScriptObject.CreateTextFile(Server.mappath("\elencofile") &"\" & strNewFolder & "\" & filename) 'Set MyFile = ScriptObject.CreateTextFile(Server.mappath("\elencofile") &"\" & filename) 'Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd)&"uploaded"&filename) For i = 1 to LenB(value) MyFile.Write chr(AscB(MidB(value,i,1))) Next '********************************** MyFile.Close

Rispondi quotando