sono due giorni che stò sbattendo la testa con questo dannato upload.....non riesco a risolvere il problema, ho provato ad impostare i permessi di scrittura, a cambiare il percorso con sito\files ma anche così niente, non sò più dove mettere le mani. Il bello è che quando carico il file non mi dà nemmeno un errore con il quale potevo individuare quale era il problema. Ho controllato anche le funzioni che salvano il file. Faccio un riepilogo del codice cheho usato, magari qualcuno può individuare l'errore. Il campo che invia il file è questo:
codice:
<FORM METHOD="Post" enctype="multipart/form-data" ACTION="uploadImg3.asp">
<font face="Arial" style="font-size: 8pt">File Big:</font>
<INPUT TYPE="file" NAME="Campo1">
<INPUT TYPE="submit" NAME="Enter" value="Ok">
</FORM>
la pagina uploadImg3.asp:
codice:
<%
Dim oUpload
Set oUpload = new cUpload
oUpload.SetPath "files\"
oUpload.UploadAndSave
Set oUpload=Nothing
%>
e queste dovrebbero essere le funzioni che salvano il file:
codice:
'+--------------------------------------------------------------------------------------------------------------
' Funzioni per l'impostazione dei percorsi
'+--------------------------------------------------------------------------------------------------------------
Public Function SetLogFile(AddInformationToLog)
EnabledLog=True
iAddInformationToLog=AddInformationToLog
end function
Public Function SetPath(StringPath)
iPath = Server.MapPath (StringPath) & "\"
If IsDataLoad then
MoveFirst
While Not EOF
Files("DestPath") = iPath
Files.Update
MoveNext
Wend
MoveFirst
end if
End function
Public Function SetLogPath(value)
iLogPath = Server.MapPath (Value)
end function
'+--------------------------------------------------------------------------------------------------------------
' Funzioni per il salvataggio files
'+--------------------------------------------------------------------------------------------------------------
Public Function SaveAs(NewName)
Dim FolderDest,FileName
If IsMultipart then
if Not Files.EOF then
If Not Files("Cancel") and Not Files("Saved") then
FolderDest = Files("DestPath")
If CreateFolderDest(FolderDest)=0 then
if NewName<>"" then FileName = SetNewName(NewName)
FileName = FolderDest & GetFileName()
If Files("AutoRename")=True then
FileName = Rename(Files("Name"),Files("Ext"),-1)
end if
If Files("Ext")<>"asp" or EnabledAspUpload then
Modules_Save FileName
else
Files.Delete
Files.Update
end if
If EnabledLog then SaveLog(LogName)
end if
end if
End if
end if
end function
Public Function LoadRemoteFile(URL,FileType,ContentType)
Dim ServerHTTP,Content,RequestBin,RequestText,FileName,StreamType,Name,iT,eT,bR
on error resume next
Set ServerHTTP = CreateObject("MSXML2.ServerXMLHTTP.4.0")
if err.number <>0 then
Set ServerHTTP = CreateObject("MSXML2.ServerXMLHTTP")
if err.number <>0 then
response.Write("<p style=""font-family:verdana;font-size:10"">Errore: L'oggetto MSXML2.ServerXMLHTTP non è installato sul server</p>")
response.end
end if
end if
on error goto 0
InitUploadFiles()
IsMultipart = true
ServerHTTP.open "GET",URL,false
ServerHTTP.Send
iT = Timer()
RequestBin = ServerHTTP.responseBody
while ServerHTTP.readyState<>4
ServerHTTP.waitForResponse 1000
wend
bR = LenB(RequestBin)
FileName = Replace(URL,"/","\")
StreamType = FileType
eT = Timer()
if (Et-iT)<>0 then
ConnectionSpeed = cStr(round((bR / (Et-iT)) / 1024,1)) & " [kb/s]"
else
ConnectionSpeed = cStr(round(bR/1024,1)) & " [kb/ms]"
end if
AddNewRs Name,FileName,ContentType,StreamType,RequestBin
MoveFirst
Set ServerHTTP = Nothing
End function
Public Function SaveLog(Name)
dim i,nFields,s,FileName,TextFile
FileName = iLogFolder & Name
s= iAddInformationToLog
if s<>"" then s = s & LogDelimiter
s = Request.ServerVariables("REMOTE_ADDR") & LogDelimiter
nFields = Files.Fields.Count
For i=0 to nFields-2
if Not IsNull(Files(i).Value) then s = s & Files(i).Value
if i <> nFields then s = s & LogDelimiter
next
If Not Fso.FileExists (FileName) then
Set TextFile= Fso.CreateTextFile(FileName,True)
else
Set TextFile = Fso.OpenTextFile(FileName,8)
end if
TextFile.WriteLine s
TextFile.Close
Set TextFile = nothing
End function
Non sò più che fare......