allora....
provo sto metodo:
codice:
....
....
'p---------------------------------------------
If instr(Intestazione,"filemanp") > 0 then
filemanp = ContenutoFile
filemanp = replace(filemanp,"'","''")
End if
' Recupero file da uploadare (se presente)
if instr(Intestazione,"docfilep") > 0 then
ip = instr(Intestazione,"filename=")
jp = instr(ip + 10,Intestazione,chr(34))
NomeUploadp = mid(Intestazione,ip + 10,jp-ip-10)
ip = instrRev(NomeUploadp,"\")
if ip<>0 then
NomeFilep = mid(NomeUploadp,ip + 1)
else
NomeFilep = NomeUploadp
end if
NomeFilep = replace(NomeFilep,"'","''")
fileupldp = percorso & NomeFilep
DimensioneFilep = len(ContenutoFile)
EstensioneFilep = right(ContenutoFile,3)
DatiFilep = ContenutoFile
end if
'1---------------------------------------------
If instr(Intestazione,"fileman1") > 0 then
fileman1 = ContenutoFile
fileman1 = replace(fileman1,"'","''")
End if
' Recupero file da uploadare (se presente)
if instr(Intestazione,"docfile1") > 0 then
i1 = instr(Intestazione,"filename=")
j1 = instr(ip + 10,Intestazione,chr(34))
NomeUpload1 = mid(Intestazione, i1 + 10, j1-i1-10)
i1 = instrRev(NomeUpload1,"\")
if i1<>0 then
NomeFile1 = mid(NomeUpload1,i1 + 1)
else
NomeFile1 = NomeUpload1
end if
NomeFile1 = replace(NomeFilep,"'","''")
fileupld1 = percorso & NomeFile1
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
DatiFile1 = ContenutoFile
end if
'p---------------------------------------------
if NomeFilep = "" then
NomeFilep = filemanp
end if
Set objFilep = Server.CreateObject ("Scripting.FileSystemObject")
If objFilep.FileExists (Server.MapPath(fileupldp)) Then
errorpost = "ERRORE: Il file selezionato è già presente sul server."
else
if ip<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFilep), True, False)
textStream.Write DatiFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
End if
end if
set objFilep = Nothing
'1---------------------------------------------
if NomeFile1 = "" then
NomeFile1 = fileman1
end if
Set objFile1 = Server.CreateObject ("Scripting.FileSystemObject")
If objFile1.FileExists (Server.MapPath(fileupld1)) Then
errorpost = "ERRORE: Il file selezionato è già presente sul server."
else
if i1<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile1), True, False)
textStream.Write DatiFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
End if
end if
set objFile1 = Nothing
....
....
ma mi da questo errore:
Tipo di errore:
Errore di run-time di Microsoft VBScript (0x800A0005)
Chiamata di routine o argomento non validi: 'mid'
/admin/newsaddp.asp, line 91
la linea 91 è:
NomeUpload1 = mid(Intestazione, i1 + 10, j1-i1-10)
non riesco proprio a risolvere questo nodo...