Advertisement

08.18.2008 at 10:37AM PDT, ID: 23657112
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

cannot get FreeASPUpload code to work

Asked by marcodiana in Active Server Pages (ASP)

Tags: ,

I am trying to create a form so that I can upload images to my website.  I have a form with only 4 other pieces of data that I would like to add to the database.  I am using the FreeASPUpload code but cannot seem to get it to work.  After looking at this for too long, I cannot figure out why it doesn't work.  I have used the code before, but the page(s) were designed/written differently.  Currently I have all pieces in the same page -- display, select, add, save -- just to make things easier on myself.  However, I wonder if that is why this code isn't working.

My ASP file is attached, but I have a main sub procedure that determines what to do next based on a hidden field on the form.    I know the code has worked without the image upload piece as I have used it elsewhere on the site, so I am guessing something I've done to try and incorporate the Upload code in the save procedure is causing the problem.

Any help would be appreciated!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
Sub Main()
%>
		<form action="tripopps_20080725002735.asp" name=MyForm method=post>
<%
		If Request.Form("AddRecord") = "True" Then 
			AddRecord
		Else
			If Request.Form("SelectRecord") = "True" Then
				SelectRecord
			Else
				If Request.Form("SaveRecord") = "True" Then SaveRecord
				DisplayAllRecords
			End If
		End If
		Set rs = Nothing
End Sub
 
''''''''''''
Sub SaveRecord()
	oUpload.Save(Server.MapPath("../images/"))
	dim ks, fileKey, sfileName
    ks = oUpload.UploadedFiles.keys
    if (UBound(ks) <> -1) then
        for each fileKey in oUpload.UploadedFiles.keys
            sfileName = oUpload.UploadedFiles(fileKey).FileName
        next
	end if
	rs.open "SELECT * FROM ListItems WHERE ItemID = " & oUpload.Form("ItemID"), cnnSuppliesDC, 1, 2 
	If Not rs.Eof Then
		If oUpload.Form("ItemName") <> "" Then rs("ItemName") = oUpload.Form("ItemName")
		If oUpload.Form("Website") <> "" Then rs("Website") = oUpload.Form("Website")
		If sfileName <> "" Then rs("Logo") = sfileName
		If oUpload.Form("ExpDate") <> "" Then rs("ExpDate") = cdate(oUpload.Form("ExpDate"))
		rs.Update
	End If
	rs.close
End Sub
Attachments:
 
ASP saved as TXT file
 
[+][-]08.19.2008 at 03:17AM PDT, ID: 22258416

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 10:58AM PDT, ID: 22272229

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 11:08PM PDT, ID: 22276605

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 11:11PM PDT, ID: 22276630

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 03:10PM PDT, ID: 22284796

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: classic ASP, Firefox
Sign Up Now!
Solution Provided By: marcodiana
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.22.2008 at 11:11PM PDT, ID: 22295973

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628