salve a tutti é la prima volta che posto nel forum cmq io ho un problema con questo codice:
la parte evidenziata é in pratica l'errore ma in teoria dovrebbe essere esattacodice:<%@LANGUAGE="VBSCRIPT" %> <% Server.ScriptTimeOut = 10000 %> <% IF(Session("id") = "" OR Session("key") = "") Then Response.Redirect("/default.asp?login=fail") Else Dim Upload Dim FileName Dim Folder Dim Ext Dim FileOK Set Upload = New clsUpload ' Grab file extension Ext = Upload.Fields("File1").FileExt ' Check to see if file extension is valid Select Case Ext Case "GIF", "PNG", "JPG" FileOK = True Case Else FileOK = False End Select ' If file was not valid If Not FileOK Then ' Notify user of error Response.Redirect("/ProfileEdit.asp?update=wrongFile") ' Stop all execution after this line. Response.End End If DIM con SET con = Server.CreateObject("ADoDB.Connection") con.Provider ="Microsoft.JET.OLEDB.4.0" con.open Server.MapPath("/db/users.mdb") Set rs = Server.CreateObject("adodb.recordset") rs.open"SELECT * FROM tUtenti WHERE utente_user='"& Session("id") &"'"& _ " AND utente_password='"& Session("key")&"'",con,2,3 IF NOT(rs.EoF) Then dim fso,ts set fso = Server.CreateObject("Scripting.FileSystemObject") if (fso.FileExists(Server.MapPath("\pictures\" & rs.Fields("imagePath")))) Then Set ts = fso.GetFile(Server.MapPath("\pictures\" & rs.Fields("imagePath"))) ts.Delete set fso = Nothing End IF Randomize dim rd rd = (20000002 - 100000) * RND + 100000 ' Grab the file name FileName = Upload.Fields("File1").FileName FileName = Replace(FileName," " , "_") FileName = Replace(FileName,".","_") FileName = FileName &"_" & rd & "." & Ext ' Get path to save file to Folder = Server.MapPath("/pictures") & "\" ' Save the binary data to the file system Upload("File1").SaveAs Folder & FileName ' Release upload object from memory Set Upload = Nothing Session("P_True") = FileName 'to send the image path in the session var 'to keep the picture in the database rs.Fields("imagePath").value = TRIM(Session("P_True")) rs.Update rs.close set rs = nothing con.close set con = Nothing Session("editProf") = "sucess" Response.Redirect("/ProfileEdit.asp") Else Session("editProf") = "fail" Response.Redirect("/ProfileEdit.asp") End IF End IF %>

Rispondi quotando