Forums
This topic is locked
please help if you have aspsmartupload exp
Posted 21 Jan 2007 18:27:32
1
has voted
21 Jan 2007 18:27:32 Rob dalton posted:
i have been trying to do the aspsmartupload tutorial for days if you have done this before please take 10 minutes to help me.i have a website which i want to allow my users to upload their images.
their details are held in a database. their images are held in a folder named musicians
i have a page with a form
<!-- AspUpload Code samples: odbc.asp -->
<!-- Saving files in the database via ODBC -->
<!-- Copyright (c) 2001 Persits Software, Inc. -->
<!-- www.persits.com -->
<HTML>
<BODY BGCOLOR="#FFFFFF">
<h3> </h3>
<FORM ACTION="odbc_upload.asp" METHOD="POST" ENCTYPE="multipart/form-data" name="formup" id="formup">
<h3>Saving Files in the Database via ODBC<br>
<input name="image_main" type=FILE id="image_main" size="30">
</h3>
<h3>
<input name="image_small" type="file" id="image_small" size="30">
</h3>
<h3><br>
<input name="image_thumb" type="file" id="image_thumb" size="30">
<br>
<input type=SUBMIT value="Upload!">
</h3>
</FORM>
<P>
If you get the error <I><FONT COLOR="#FF0000">[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query</FONT></I>,
adjust permissions on the file <B>\Samples\04_db\aspupload.mdb</B> with Windows Explorer.
</BODY>
</HTML>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
i have changed the names of the fields to corrispond with my database field names.
the other page is the upload page
<%@LANGUAGE="VBSCRIPT"%><!-- AspUpload Code samples: odbc_upload.asp -->
<!-- Invoked by odbc.asp -->
<!-- Copyright (c) 2001 Persits Software, Inc. -->
<!-- www.persits.com -->
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload"
' Capture files
Upload.Save "C:\Inetpub\wwwroot\website\starsearchentertainment.com\images\musicians"
' Obtain file object
Set File = Upload.Files(image_main, image_small, image_thumb)
If Not File Is Nothing Then
' Build ODBC connection string
Connect = "Driver=SQL Server;Server=win10.cmmwebhosting.com;Database=starsearch.mdb;UID=robdalto;PWD=starry456"
' If you use SQL Server, the connecton string must look something like this:
' Connect = "Driver=SQL Server;Server=MYSRV;Database=starsearch.mdb;UID=robdalton;PWD=starry456"
' Build SQL INSERT statement
SQL = "INSERT INTO Artisttable(image_main, image_small, image_thumb) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("formup", "'", "''" & "', "
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>
i have changed the path of the upload file but i still cant get it to work
how does the upload know what details to store the files to
why wont it work have i done something wrong.
PLEASE HELP!
Replies
Replied 22 Jan 2007 08:53:18
22 Jan 2007 08:53:18 Charles Knight replied:
This a forum for Pure Asp Upload by george Petrov not Aspsmartupload by Persists...
Not sure if your get much help here!!!
DWMX | ASP | ACCESS
Not sure if your get much help here!!!
DWMX | ASP | ACCESS