Forums

ASP

This topic is locked

Upload/resize- Pass to next page and show image

Posted 30 Jan 2005 01:45:08
1
has voted
30 Jan 2005 01:45:08 David Ortiz posted:
Hello, I am using your products- ASP UPLOAD AND IMAGE PROCESSING-

I have the image being uploaded and placed in a database- Working great.

I have everything working except for the following.

<b>On the confirmation page, I can not get the uploaded image to display. It only displays the first image that was uploaded to the server.

Can you help me???

Here is the page: www.voila.us/icon/upload2.asp

I can't get the second page to get the image that you upload from the first page. I want the user to be able t see the image they uploaded.

Please help!!!!!!!!!!!!!!!!!

Thanks!
</b>

Edited by - fdavidortiz on 30 Jan 2005 02:33:32

Edited by - fdavidortiz on 30 Jan 2005 02:42:34

Replies

Replied 30 Jan 2005 14:50:11
30 Jan 2005 14:50:11 Simon Martin replied:
Hi David.
Sounds to me like the confirmation page isn't being filtered - so its displaying the first item in its recordset. What you need to do is somehow tell that page what the ID number is for the record you've just created. But how do you know what the ID number is because the database does all that for you right...?

You could use the InsertWithIdent extension www.dmxzone.com/showDetail.asp?TypeId=3&NewsId=195 or follow this tutorial www.dmxzone.com/showDetail.asp?TypeId=2&NewsId=3932 to get the @@IDENTITY value of your new record. Then if you pass that to your confirmation page you can filter the recordset so it only has the details for the record just inserted.

Alternatively you <i>could</i> pass details of all the items on the page, including the image name, as hidden fields, but this approach is not as robust. Personally I would retrieve the information from the database

Live the life you love
Love the life you live

Simon
Replied 30 Jan 2005 19:43:47
30 Jan 2005 19:43:47 David Ortiz replied:
WHat you are saying is true- I need the ID to be passed.

I am not a coder. I downloaded your extension. I went to your next page and I must say I am not as advanced with coding and I don't understand your tutorial.

I appreciate your help.

I am not advance with code.

I still need help.
Replied 30 Jan 2005 21:02:50
30 Jan 2005 21:02:50 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>WHat you are saying is true- I need the ID to be passed...I appreciate your help...I am not advance with code...I still need help.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Can you post your SQL code to see if anything needs fixin' there. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 30 Jan 2005 21:42:12
30 Jan 2005 21:42:12 David Ortiz replied:
&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="Connections/connImages.asp" --&gt;
&lt;!--#include file="ScriptLibrary/incPureUpload.asp" --&gt;
&lt;%
'*** Pure ASP File Upload 2.1.9
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """img"""
pau_Extensions = "GIF,JPG,JPEG,BMP,PNG"
pau_Form = "UPLOAD"
pau_Redirect = ""
pau_storeType = "file"
pau_sizeLimit = ""
pau_nameConflict = "uniq"
pau_requireUpload = "true"
pau_minWidth = "100"
pau_minHeight = "100"
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = "RedFlashProgress.htm"
pau_progressWidth = "300"
pau_progressHeight = "100"

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.19
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if
%&gt;
&lt;%
' *** Edit Operations: (Modified for File Upload) declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (UploadQueryString &lt;&gt; "" Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(UploadQueryString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%&gt;
&lt;%
' *** Insert Record: (Modified for File Upload) set variables

If (CStr(UploadFormRequest("MM_insert") = "UPLOAD" Then

MM_editConnection = MM_connImages_STRING
MM_editTable = "Images"
MM_editRedirectUrl = "uploaded.asp"
MM_fieldsStr = "Username|value|file2|value|Comments|value"
MM_columnsStr = "Usernames|',none,''|Images|',none,''|Comments|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl &lt;&gt; "" And UploadQueryString &lt;&gt; "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString &lt;&gt; "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
End If
End If

End If
%&gt;
&lt;%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(UploadFormRequest("MM_insert") &lt;&gt; "" Then

' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal &lt;&gt; "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i &lt;&gt; LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl &lt;&gt; "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%&gt;

Dreamweaver MX, ASP, Access DB.

i Rarely handcode- I use your products. I am a visual person and I can't seem to understand the SQL yet. I understand ASP- I think.. I've been doing this for 10 years and I haven't had to hand code yet- LOL.

Reply to this topic