Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help me please anyone with aspupload exp

New Here ,
Jan 21, 2007 Jan 21, 2007
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. -->
<!-- http://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. -->
<!-- http://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!
TOPICS
Server side applications
234
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2007 Jan 21, 2007
LATEST
Did you see my reply to this the other day. It's a permissions problem.

--
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004




Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines