Dreamweaver and ASPUpload

I have a question.
I have the following form and i'm using dwzone.it Extension ASPUpload to change pictures.  Everything is working fine except that when the upload works, it doesn't show my new picture.  The old picture is still there and you have to hit the refresh button in the browser to show the new picture.  Is there a way to automatically refresh after everything takes place?

Here is the code.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#include file="../Connections/inah_SQL.asp" -->
<%
Dim RS1Member__MMColParam
RS1Member__MMColParam = "1"
If (Request.QueryString("MemberID") <> "") Then
  RS1Member__MMColParam = Request.QueryString("MemberID")
End If
%>
<%
Dim RS1Member
Dim RS1Member_numRows

Set RS1Member = Server.CreateObject("ADODB.Recordset")
RS1Member.ActiveConnection = MM_inah_SQL_STRING
RS1Member.Source = "SELECT * FROM dbo.inah_member WHERE MemberID = " + Replace(RS1Member__MMColParam, "'", "''") + ""
RS1Member.CursorType = 0
RS1Member.CursorLocation = 2
RS1Member.LockType = 1
RS1Member.Open()

RS1Member_numRows = 0
%>


<%
'*********************************
'*                               *
'*  ONLY UPLOAD                  *
'*  http://www.dwzone.it         *
'*                               *
'*********************************
      server.ScriptTimeout = 5400

      Dim RG_Connection, RG_editColumn, RG_recordId, Form, editAction, editRedirectUrl, RG_Files, RG_formName, UploadType, ParamVal, ParamList, MaxFieldNumber, TmpVal, x, y, Key, ProgressBar, UploadStatus, NumFile
      Dim RG_altVal, RG_columns, RG_Cong, RG_dbValues, RG_dbValuesTmp, RG_delim, RG_editCmd, RG_editQuery, RG_editQueryTmp, RG_emptyVal, RG_Ext, RG_Extensions, RG_fields, RG_FieldValueTmp, RG_FileDel, RG_FileExt, RG_formVal, RG_FS, RG_i, RG_L, RG_Len, RG_Max, RG_Name, RG_New, RG_newName, RG_Num, RG_Path, RG_Rec, RG_ret, RG_Save, RG_tableValues, RG_tableValuesTmp, RG_tst, RG_typeArray, RG_z
      Dim tmpField_Name(), tmpValue_Name(), tmpField_Size(), tmpValue_Size(), QtyRecord, TotalFileSize, valueToRedirectSend

      Set Form = New ASPForm
      UploadID = Form.NewUploadID
      ProgressBar = ""
      TotalFileSize = ""
      editRedirectUrl = "memberpicture.asp"
      RG_Files = ";3;;.jpg, .gif, .jpeg, .bmp;;0;;1;;;;-1;;;;;;Pic1FileAdd@_@_@0@_@_@ @_@_@@_@_@../"
      RG_formName = "form1"
      UploadType="Upload"
      UploadStatus = ""
      valueToRedirectSend = "MemberID"
      NumFile = 0

      if len(Request.QueryString("UploadID"))>0 then
            Form.UploadID = Request.QueryString("UploadID")
      end if
      
      if (Request.QueryString <> "") Then
             editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?" & Request.QueryString & "&UploadID=" & UploadID
      else
             editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) & "?UploadID=" & UploadID      
      End If
      
Const fsCompletted  = 0

If Form.State = fsCompletted Then
  if Form.State = 0 then
            
            Set ParamVal = CreateObject("Scripting.Dictionary")
            tmp = split(RG_Files,"@_@_@")
            ParamList = split(tmp(0),"|")
            MaxFieldNumber = ubound(ParamList)
            for x=0 to Ubound(ParamList)
                  TmpVal = Split(ParamList(x),";")
                  for y=0 to ubound(TmpVal)
                        Key = right("00" & cstr(x),3) & cstr(y)
                        ParamVal.add Key, TmpVal(y)
                  next
            next
            Form.Files.Save
            response.write(getRedirect())
            response.end
  End If
ElseIf Form.State > 10 then
  response.write "<br><Font Color=red>Some form error.<br>Error code: " & Form.State & "<br>Error List:<br>0  Form was successfully processed. <br>1  Request method is NOT post <br>2  Zero length request (there are no data in a source form) <br>3  Form is in a middle of process. <br>5  Initial form state <br>11  Boundary of multipart/form-data is not specified. <br>12  Unknown source form (Content-type must be multipart/form-data) <br>15  Client was disconnected before upload was completted.<br>16  Unexpected error from Request.BinaryRead method (ASP error).<br></Font><br>"
End If


function GetFolderName(str): select case Str: case "Pic1FileAdd": Ris = server.MapPath("/images/memberpics/" & UploadFormRequest("MemberID")): end select: GetFolderName = Ris : end function

function myGetFileName(str): select case Str: case "Pic1FileAdd": Ris = UploadFormRequest("MemberID") & "a": end select: myGetFileName = Ris : end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="pragma" content="no-cache"; charset=iso-8859-1"/>
<title>Member Pictures</title>
</head>

<body bgcolor="#FFFFFF">

<!--#INCLUDE FILE="../member/memberheader.asp"-->
<font face="Arial">
<table width="80%" border="0" align="center" bgcolor="#FFFFCC" id="table1">
    <tr>
      <td align="right" colspan="3" bgcolor="#FFFFCC"></td>
  <tr>
            <td bgcolor="#FFFFCC">
            <p align="center"><font face="Arial">Member # <b><%=(RS1Member.Fields.Item("MemberID").Value)%></b> Website Information</font>                  </td>
  </tr>
          <tr>
            <td bgcolor="#FFFFCC"><div align="center"><font face="Arial"><i><font size="2">Please update your member website below</font></i></font>
            </div></td>
             </tr>
           <tr>
         <td bgcolor="#FFFFCC">
             <font face="Arial" size="2" color="#FF0000">
             <p align="center"><a href="membermain.asp?Email=<%=(RS1Member.Fields.Item("Email").Value)%>&Pass1=<%=(RS1Member.Fields.Item("Pass1").Value)%>">
             <font color="#FF0000">&lt;&lt; Back to Member Main</font></a></font></td></tr></table>

<br><br>
<table width="90%" border="0" align="center" bgcolor="#FFFFFF" id="table2">
      <form ACTION="<%=editAction%>" onsubmit="return ProgressBar()" method="post" name="form1" id="form1" enctype="multipart/form-data">
      <tr valign="baseline">
      <td align="right">This is your current Picture 1:<br>
          <font face="Arial" size="2">
            <img border="0" src="../images/memberpics/<%=(RS1Member.Fields.Item("MemberID").Value)%>/<%=(RS1Member.Fields.Item("MemberID").Value)%>a.jpg" alt="No Picture Uploaded Yet" width=200 height=150></font></td>
         <td width=20>&nbsp;</td>
        <td>

            <font face="Arial"><br />
            Change/Add Picture 1: </font><br />
            <label>
            <input name="Pic1FileAdd" type="file" onchange="dwz_setEvent(this,'change')" onclick="dwz_setEvent(this,'click')" >
            </label>
            <br />
            <br />
            <br>
            <input type="hidden" name="MemberID" value="<%=((RS1Member.Fields.Item("MemberID").Value))%>">
            <br>
            <label>
            <input type="submit" name="Submit" value="Update Your Picture 1">
            </label></td>
      </tr>
</form>


                  
            <tr valign="baseline">
              <td nowrap align="right"></td>
              <td><div align="left"></div></td>
                    <td>&nbsp;</td>
            </tr>
                  
</table>
</font>


<font face="Arial">
</table>
</font>
</body>
</html>
<!--#include file="../dwzUpload/Upload.asp" -->
<!--#include file="../dwzUpload/UploadAdvanced.asp" -->
<%
RS1Member.Close()
Set RS1Member = Nothing
%>

Thanks, Austin
USCBigRedAsked:
Who is Participating?
 
pcaiooConnect With a Mentor Commented:

<form name="redirect" method="post">
</form>
<SCRIPT language="javascript">
      function redirect(){
       setTimeout('document.forms[0].submit();', 10);
      }
</SCRIPT>

or

<meta http-equiv="refresh" content="2">
 but make sure do a if else so they don't come out every time. and only show went refresh is needed.
0
 
pcaiooCommented:
try put this on the frist line of the page

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
it will force the file to reload every time
0
 
USCBigRedAuthor Commented:
that still doesn't work.  I tried it inside the <HEAD> tags and at the top line.  It doesn't refresh the pictures on the page unless I hit the Refresh button on the browser.  How can I do that automatically without having the user have to hit the button.  Even if the page flashes, it wouldn't matter to me.

Austin
0
 
USCBigRedAuthor Commented:
Thanks so much!!
0
All Courses

From novice to tech pro — start learning today.