Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
please help if you have exp with aspsmartupload
Old 01-21-2007, 12:22 PM please help if you have exp with aspsmartupload
Experienced Talker

Posts: 39
Name: Rob
Trades: 0
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>&nbsp;</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\starsearchentertainmen t.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=sta rsearch.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=ro bdalton;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!
starsearch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to please help if you have exp with aspsmartupload
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37632 seconds with 12 queries