Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to update image using
C++
aspSmartUpload

, The image is not getting uploaded over database.
I you can let help to know where I am making mistake in update statement.

Thank you in advance.

Regards,
hardik.


VB
<%

Dim mySmartUpload

Dim Conn,strSQL,objExec ,strConnect,file



'*** Create Object ***'

Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")



'*** Upload Files ***'

mySmartUpload.Upload

'*** Upload file1 ***'

'If mySmartUpload.Files("Photo").FileName <> "" Then
'
'mySmartUpload.Files("Photo").SaveAs(Server.MapPath("MyFiles/" & mySmartUpload.Files("Photo").FileName))
''
'Response.write mySmartUpload.Files("Photo").Name & " Uploaded.<br>"

'*** Update Record ***'

Set Conn = Server.Createobject("ADODB.Connection")
strConnect = MM_Proactive_STRING
Conn.Open strConnect

strSQL = ""
strSQL = strSQL &"UPDATE tbl_Students SET Photo = ('"& mySmartUpload.Files("Photo").Name&"'),Photoname=('"& mySmartUpload.Files("Photo").FileName &"')  Where StudentID=" & ID & ""
Set objExec = Conn.Execute(strSQL)

'End If

Response.write("updated" & "<BR>")
Response.Write("Name = " & mySmartUpload.Files("Photo").Name & "<BR>")
Response.Write("Size = " & mySmartUpload.Files("Photo").Size & "<BR>")
Response.Write("FileName = " & mySmartUpload.Files("Photo").FileName & "<BR>")
Response.Write("FileExt = " & mySmartUpload.Files("Photo").FileExt & "<BR>")
Response.Write("FilePathName = " & mySmartUpload.Files("Photo").FilePathName & "<BR>")
Response.Write("ContentType = " & mySmartUpload.Files("Photo").ContentType & "<BR>")
Response.Write("ContentDisp = " & mySmartUpload.Files("Photo").ContentDisp & "<BR>")
Response.Write("TypeMIME = " & mySmartUpload.Files("Photo").TypeMIME & "<BR>")
Response.Write("SubTypeMIME = " & mySmartUpload.Files("Photo").SubTypeMIME & "<BR>")



Set mySmartUpload = Nothing
%>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900