Ciao a tutti io ho questa funzione:
<%
function Rinomina (idCliente, nomeFile, cartella)
Dim fso, sPath, sNewFile, sOldFile
'percorso fisico dove risiede il file
if cartella="piccole" then
sPathOld = Server.MapPath(".") & "\allegati_mercatino\piccole"
sPathNew = Server.MapPath(".") & "\allegati_mercatino\piccole"
else
sPathOld = Server.MapPath(".") & "\allegati_mercatino\grandi"
sPathNew = Server.MapPath(".") & "\allegati_mercatino\grandi"
end if
'file da rinominare
sOldFile = nomeFile
'nuovo nome
sNewFile = "_" & idCliente & nomeFile
Set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.MoveFile sPathOld & "\" & sOldFile, sPathNew & "\" & sNewFile
Set fso = Nothing
Rinomina=sNewFile
end function
%>
<%
set rs=server.CreateObject("adodb.recordset")
server.ScriptTimeout=3000
Response.Expires=-1500
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Dim UploadRequest
'QUESTA FUNZIONE RECUPERA IL VALORE DEI CAMPI TESTUALI
function RequestForm(nome_campo)
Set UploadRequest = CreateObject("Scripting.Dictionary")
BuildUploadRequest RequestBin
contentType = UploadRequest.Item(nome_campo).Item("ContentType")
filepathname = UploadRequest.Item(nome_campo).Item("FileName")
filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
value = UploadRequest.Item(nome_campo).Item("Value")
Set UploadRequest = nothing
RequestForm=value
end function
'inserimento file 1
filename_1=""
Set UploadRequest = CreateObject("Scripting.Dictionary")
BuildUploadRequest RequestBin
contentType = UploadRequest.Item("allegato_1").Item("ContentType ")
filepathname = UploadRequest.Item("allegato_1").Item("FileName")
filename_1 = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
value = UploadRequest.Item("allegato_1").Item("Value")
if filename_1 <> "" then
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
' da modificare
pathEnd=server.MapPath(".") & "\allegati_mercatino\piccole\" & filename_1
Set MyFile = ScriptObject.CreateTextFile(pathEnd)
For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next
MyFile.Close
filename_1=Rinomina(session("id_cliente"), filename_1, "piccole")
end if
Set UploadRequest = nothing
e mi funzionava benissimo sul 2000 server ma ora che sono passato al 2003 mi da errore, è un problema di impostazione del server?

Rispondi quotando
