Get Session Var

October 23, 2002 by Robert Kruse

I can't get this code to work. Where exactly after the upload code do you put it? I have an upload page that redirects to a details page that displays the name of the file just uploaded.

 

I've been putting the code at the end:
...
else
  if UploadQueryString <> "" then
    UploadQueryString = UploadQueryString & "&GP_upload=true"
  else 
    UploadQueryString = "GP_upload=true"
  end if 
end if 

If (CStr(Request.QueryString("GP_upload")) <> "") Then
  Session("PDFFileName") = UploadFormRequest("filename1")
end if

' End Pure Upload
'------------------------------------------------------------------------------
</SCRIPT>

And it is not setting the session variable. Any tips?

Thanks

UploadFormRequest + Manual Insert

October 28, 2002 by chris hart

I am having the same problem.

I can't seem to grab the filename nor any of my fields using the UploadFormRequest syntax. I don't use Dreamweaver MX's insert behavior (I hand write the SQL) and i am trying to store my field names in a session variable and pass them into a second page to insert them into a SQL DB.

How do you grab the form values in addition to the uploaded filename?

RE: Get Session Var

October 28, 2002 by chris hart

Robert,
I figured this one out. Throughout the UDZone site the continual message has been put the UploadFormRequest syntax below the 'End Pure Upload Comment.This is wrong, because using the redirect, the page redirects before the session variables are set.

Try Putting it above the redirect syntax. So putting it right here:

'PUT YOUR SESSION VAR DECLARATION HERE-----------------------
If (CStr(Request.QueryString("GP_upload")) <> "") Then
    session("filename") = UploadFormRequest("file")
  end if
'--------------------------------------------------------------------
If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then
    If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
      GP_redirectPage = GP_redirectPage & "?" & UploadQueryString
    End If
    Response.Redirect(GP_redirectPage) 
  end if 
else
  if UploadQueryString <> "" then
    UploadQueryString = UploadQueryString & "&GP_upload=true"
  else 
    UploadQueryString = "GP_upload=true"
  end if
'------------------------

Form Submitting on the redirect

October 28, 2002 by chris hart
George,

Is there a way to form.submit() after the upload has taken place instead of redirecting to a new page losing my form elements?

I am inserting quite a bit of data into a DB and can't afford the overhead of converting all my form element's values into session variables and then inserting them within that same page.

Please advise. Thanks.