Passing a value

Results 1 to 2 of 2

Thread: Passing a value

  1. #1
    Join Date
    Dec 1969

    Default Passing a value

    I need help passing a parameter to the below function. The function works if I hard code the filename where it says, "place here". But, I&#039;m not sure how to make it except the value being passed. <BR><BR><BR>template=request("template")%&#062;<BR ><BR><BR>&#060;% <BR> <BR> Dim Stream<BR> Dim Contents<BR> Dim FileName<BR> Dim FileExt<BR> Const adTypeBinary = 1<BR> FileName = "place here"<BR> If FileName = "" Then<BR> Response.Write "Filename not specified."<BR> Response.End<BR> End If<BR> &#039; Make sure they are not requesting your<BR> &#039; code<BR> FileExt = Mid(FileName, InStrRev(FileName, ".") + 1)<BR> Select Case UCase(FileExt)<BR> Case "ASP", "ASA", "ASPX", "ASAX", "MDB"<BR> Response.Write "Protected file not allowed."<BR> Response.End<BR> End Select<BR> &#039; Download the file<BR> Response.Clear<BR> Response.ContentType = "application/octet-stream"<BR> Response.AddHeader "content-disposition", "attachment; filename=" & FileName<BR> Set Stream = server.CreateObject("ADODB.Stream")<BR> Stream.Type = adTypeBinary<BR> Stream.Open<BR> Stream.LoadFromFile Server.MapPath(FileName)<BR> While Not Stream.EOS<BR> Response.BinaryWrite Stream.Read(1024 * 64)<BR> Wend<BR> Stream.Close<BR> Set Stream = Nothing<BR> Response.Flush<BR> Response.End<BR> %&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default I'm've lost me...

    WHAT function????<BR><BR>You mean<BR> Request(argument)<BR>???<BR><BR>Are you saying you want to do<BR> Filename = Request( something )<BR>???<BR><BR>If so, how are you passing that "something" from the prior page? As a querystring? As a form POST value? How do you know that something *is* being passed?<BR><BR>Maybe you need to show the *prior* page, instead of this one?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts