credo di aver capito allora il problema con l'upload é finito ora il problema persiste nel codice seguente che si chiama salva.asp
codice:
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload")
On Error Resume Next
Upload.Save(Server.MapPath("pictures/temp")) 'to save the file in our temporary file for first
'time, that we can use the upload form mehtod against request form
dim typ
typ = Upload.Files("File1").ImageType 'to check if the file is not in the jpg/gif or png format
if(typ <> "jpg" AND typ <> "JPG" AND typ <> "GIF" AND typ <> "gif" AND typ <> "PNG" AND typ <> "png") Then
For Each File in Upload.Files
File.Delete
Next
Response.Redirect("makeProfile.asp?ok=wrongFile")
'response.write("File format = "& typ)
End IF
Session("pic") = (Upload.Files("File1").FileName) 'to get the file name in the sessino object
'Response.write(Session("pic")) check to get the name of the file in our session object
'Response.End closing testing to print the name
dim fname,lname,emailsho,nickname,country,email,hobbies,aboutme,sex,key
fname = Trim(Upload.Form("fname"))
lname = Trim(Upload.Form("lname"))
sex = Trim(Upload.Form("sex"))
emailsho = Trim(Upload.Form("sho"))
key = Trim(Upload.Form("key"))
nickname = Trim(Upload.Form("nickname"))
country = Trim(Upload.Form("country"))
email = Trim(Upload.Form("email"))
hobbies = Trim(Upload.Form("hobbies"))
aboutme = Trim(Upload.Form("aboutme"))
dim chk
IF(emailsho = "ON") Then
chk = true
Else
chk = false
End IF
IF(fname = "" OR lname = "" OR sex = "" OR key = "" OR nickname = "" _
OR country = "" OR email = "" OR hobbies = "" OR aboutme = "") then
For Each File in Upload.Files
File.Delete
Next
Response.Redirect("makeProfile.asp?ok=emptyFields")
Response.End
End IF
dim fileName,rn, NewFil,extn
Randomize
rn =(987654321 - 12345678) * RND + 1234567
fileName = Trim(Session("pic"))
NewFil = Replace(fileName," ","")
NewFil = Replace(NewFil,".","-")
extn = Replace(fileName," ","")
NewFil = NewFil &"_"& rn &"_"& extn
DIM con, rs, fs, ts
SET con = Server.CreateObject("ADoDB.Connection")
con.Provider ="Microsoft.JET.OLEDB.4.0"
con.open Server.MapPath("record/userInfo.mdb")
Set rs = Server.CreateObject("adodb.recordset")
rs.Open "SELECT * FROM tUtenti WHERE utente_user='"& nickname &"'"&" OR utente_email='"& email &"'",con,2,3
If rs.EOF Then
set fs = Server.CreateObject("Scripting.FileSystemObject")
If(fs.FileExists(Server.MapPath("pictures/temp/" & fileName))) Then
fs.MoveFile Server.MapPath("pictures/temp/"& fileName), Server.MapPath("pictures/" & NewFil)
Set fs = Nothing
End If
rs.AddNew
rs.Fields("utente_nome").value = fname
rs.Fields("utente_cognome").value = lname
rs.Fields("utente_user").value = nickname
rs.Fields("utente_emailShow").value = chk
rs.Fields("imagePath").value = NewFil
rs.Fields("utente_password").value = key
rs.Fields("maleFemale").value = sex
rs.Fields("U_Time").value = Now()
rs.Fields("utente_email").value = email
rs.Fields("hobbies").value = hobbies
rs.Fields("utente_informazione").value = aboutme
rs.Fields("Cust_Country").value = country
rs.Update
rs.close
dim snd
snd = false
'Send email to new user with his/her id and password for editing informations.
msubject = "Welcome to profile web site"
mbody = "<table border=0 width='100%' bgcolor=lightyellow>"
mbody = "<tr><Td><fieldset><legend><font color='blue' face='verdana' size='3pt'>"
mbody = "Admin: Shah Hussain (Shah thefire)</legend></font>
<table border=0 cellspacing=6 cellpaddig=7 width='100%' bgcolor='black'>"
mbody = mbody & "<TR><TD>[b]<font color=white face=verdana>Hello Dear User "& nickname &"<font></td></tr>"
mbody = mbody & "<tr><td><font color=lightblue face=verdana size=3pt>Please keep your Details:</font></td></tr>"
mbody = mbody & "<tr><td><font color=lightgreen face=verdana size=3pt><blockquote>"
mbody = mbody & "[list=1][*]Your Nick Name is : " & nickname &""
mbody = mbody & "[*]Your First Name is : " & fname &""
mbody = mbody & "[*]Your Last Name is : " & lname &""
mbody = mbody & "[*]Your Password is : " & key &""
mbody = mbody & "</td></tr><tr><td bgcolor=lightyellow><font color=blue face=verdan>"
mbody = mbody & "<div align=center>If you want to Edit your Profile click on the link:"
mbody = mbody & "Edit Profile </font></div></td></tr></table>
</fieldset>"
smailserver = "127.0.0.1"
Set objmail = Server.CreateObject("CDO.Message")
Set objconf = Server.CreateObject("CDO.configuration")
Set objfields = objconf.Fields
with objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smailserver
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End with
with objmail
set.Configuration = objconf
.From = "Admin Shah Thefire"
.To = Trim(Upload.Form("email"))
.Subject = msubject
.HTMLBody = mbody
End with
Err.Clear
on Error Resume Next
objmail.Send
If Len(Err.Description) = 0 Then
snd = true
Else
snd = false
End IF
'response.write"
<div align=center><font color='blue' face=verdana size=3pt>"
'response.write"Your Profile Details has been sent to your eamil :" & email & " </font></div>
"
set objFields = Nothing
set objConf = Nothing
set objMail = Nothing
'Response.write("<div style='background-color:blue;'>" & snd &"</div>")
Response.Redirect("default.asp?ok=Welcome")
Else
set fs = Server.CreateObject("Scripting.FileSystemObject")
IF(fs.FileExists(Server.MapPath("pictures/temp/" & Session("pic")))) Then
set ts = fs.GetFile(Server.MapPath("pictures/temp/" & Session("pic")))
ts.Delete
End If
set fs = Nothing
Response.Redirect("makeProfile.asp?ok=alreadyExists")
End If
set rs = nothing
con.close
set con = Nothing
%>
</BODY>
</HTML>