Hello Everyone,
Im using aspupload to upload files to a mysql database, but the code provided by aspupload if for sql. My question is does the code need to be changed for it to run with mysql?
Ive beenworking on if for days now and still cannot get it to work.
Here is what I have been given
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload"
' Capture files
Upload.Savevirtual "\uploads"
' Obtain file object
Set File = Upload.Files("THEFILE"
If Not File Is Nothing Then
' Build ODBC connection string
Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(".\aspupload.mdb"
' If you use SQL Server, the connecton string must look as follows:
' Connect = "Driver=SQL Server;Server=MYSERVER;UID=sa;PWD=xxxxxxxxx"
' Build SQL INSERT statement
SQL = "INSERT INTO MYIMAGES(image_blob, filename, description, filesize) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("DESCR", "'", "''" & "', "
SQL = SQL & File.Size & ""
' Save to database
File.ToDatabase Connect, SQL
Response.Write "File saved."
Else
Response.Write "File not selected."
End If
%>
</BODY>
</HTML>
Any help on this would be greatly appreciated or if anyone has it working with mysql could you possible provide me with the right code, as I have ben trying to get it work for days now.
Best Regards
James
Im using aspupload to upload files to a mysql database, but the code provided by aspupload if for sql. My question is does the code need to be changed for it to run with mysql?
Ive beenworking on if for days now and still cannot get it to work.
Here is what I have been given
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload"
' Capture files
Upload.Savevirtual "\uploads"
' Obtain file object
Set File = Upload.Files("THEFILE"
If Not File Is Nothing Then
' Build ODBC connection string
Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(".\aspupload.mdb"
' If you use SQL Server, the connecton string must look as follows:
' Connect = "Driver=SQL Server;Server=MYSERVER;UID=sa;PWD=xxxxxxxxx"
' Build SQL INSERT statement
SQL = "INSERT INTO MYIMAGES(image_blob, filename, description, filesize) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("DESCR", "'", "''" & "', "
SQL = SQL & File.Size & ""
' Save to database
File.ToDatabase Connect, SQL
Response.Write "File saved."
Else
Response.Write "File not selected."
End If
%>
</BODY>
</HTML>
Any help on this would be greatly appreciated or if anyone has it working with mysql could you possible provide me with the right code, as I have ben trying to get it work for days now.
Best Regards
James