Persits.Upload.1 and multiple checkbox

Discussion in 'ASP General' started by Vanessa, Jan 16, 2006.

  1. Vanessa

    Vanessa Guest

    I have an ASP script which is used to upload files with Persits.Upload.1
    object. But I can't get the values from mutliple checkboxes in the form like
    normally.

    <form method="post" ENCTYPE="multipart/form-data"....>
    <input type="checkbox" name="language" value="English">English
    <input type="checkbox" name="language" value="Spanish">Spanish
    <input type="checkbox" name="language" value="Chinese">Chinese

    Please advice!
     
    Vanessa, Jan 16, 2006
    #1
    1. Advertising

  2. Vanessa

    Larry Bud Guest

    Vanessa wrote:
    > I have an ASP script which is used to upload files with Persits.Upload.1
    > object. But I can't get the values from mutliple checkboxes in the form like
    > normally.
    >
    > <form method="post" ENCTYPE="multipart/form-data"....>
    > <input type="checkbox" name="language" value="English">English
    > <input type="checkbox" name="language" value="Spanish">Spanish
    > <input type="checkbox" name="language" value="Chinese">Chinese
    >
    > Please advice!


    What's your code to retrieve those values? You can't use request.form,
    you need to create the Persits object such as

    Set Upload = Server.CreateObject("Persits.Upload.1")
    thelanguage=upload.form("language")
     
    Larry Bud, Jan 16, 2006
    #2
    1. Advertising

  3. Vanessa

    Vanessa Guest

    Larry,

    Here is my test code:

    <%
    if Request.ServerVariables("REQUEST_METHOD") = "POST" then

    Set Upload = Server.CreateObject("Persits.Upload.1")
    Upload.IgnoreNoPost = True
    Upload.OverwriteFiles = true
    Upload.SetMaxSize 3048576
    Upload.SaveToMemory

    Response.Write "Upload.Form(""language""): " & Upload.Form("language") &
    ":<BR>"

    else
    %>

    <form method="post" action="testcheckbox.asp" enctype="multipart/form-data">
    <input type="checkbox" name="language" value="English" checked>English<br>
    <input type="checkbox" name="language" value="Spanish" checked>Spanish<br>
    <input type="checkbox" name="language" value="Chinese" checked>Chinese<br>
    <input type="submit" name="submit" value="submit">

    </form>

    <% end if %>

    It only get the first checked values, but not all checked values. For
    example, if I checked English and Spanish, only English is returned from
    Upload.Form("language"). Please advice.

    Vanessa

    "Larry Bud" wrote:

    >
    > Vanessa wrote:
    > > I have an ASP script which is used to upload files with Persits.Upload.1
    > > object. But I can't get the values from mutliple checkboxes in the form like
    > > normally.
    > >
    > > <form method="post" ENCTYPE="multipart/form-data"....>
    > > <input type="checkbox" name="language" value="English">English
    > > <input type="checkbox" name="language" value="Spanish">Spanish
    > > <input type="checkbox" name="language" value="Chinese">Chinese
    > >
    > > Please advice!

    >
    > What's your code to retrieve those values? You can't use request.form,
    > you need to create the Persits object such as
    >
    > Set Upload = Server.CreateObject("Persits.Upload.1")
    > thelanguage=upload.form("language")
    >
    >
     
    Vanessa, Jan 16, 2006
    #3
  4. Vanessa

    Larry Bud Guest

    Vanessa wrote:
    > Larry,
    >
    > Here is my test code:
    >
    > <%
    > if Request.ServerVariables("REQUEST_METHOD") = "POST" then
    >
    > Set Upload = Server.CreateObject("Persits.Upload.1")
    > Upload.IgnoreNoPost = True
    > Upload.OverwriteFiles = true
    > Upload.SetMaxSize 3048576
    > Upload.SaveToMemory

    .....

    Vanessa, you need to read the manual. I don't have Persits installed
    on my machine, but since you do, you should have the Form3.asp demo
    page that they're talking about.

    http://www.aspupload.com/manual_simple.html

    >From the section titled

    "Referencing Individual File and Form Items"

    The Upload.Form collection is not entirely identical to Request.Form as
    ******it handles multi-select form items such as <SELECT MULTIPLE>
    differently.*******

    A multiple checkboxes with the same name are probably handled like a
    select multiple.
     
    Larry Bud, Jan 16, 2006
    #4
  5. Vanessa

    Vanessa Guest

    Got it! Thanks Larry! :) You save my day!

    "Larry Bud" wrote:

    >
    > Vanessa wrote:
    > > Larry,
    > >
    > > Here is my test code:
    > >
    > > <%
    > > if Request.ServerVariables("REQUEST_METHOD") = "POST" then
    > >
    > > Set Upload = Server.CreateObject("Persits.Upload.1")
    > > Upload.IgnoreNoPost = True
    > > Upload.OverwriteFiles = true
    > > Upload.SetMaxSize 3048576
    > > Upload.SaveToMemory

    > .....
    >
    > Vanessa, you need to read the manual. I don't have Persits installed
    > on my machine, but since you do, you should have the Form3.asp demo
    > page that they're talking about.
    >
    > http://www.aspupload.com/manual_simple.html
    >
    > >From the section titled

    > "Referencing Individual File and Form Items"
    >
    > The Upload.Form collection is not entirely identical to Request.Form as
    > ******it handles multi-select form items such as <SELECT MULTIPLE>
    > differently.*******
    >
    > A multiple checkboxes with the same name are probably handled like a
    > select multiple.
    >
    >
     
    Vanessa, Jan 16, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    844
    David Wier
    Oct 6, 2006
  2. John Rebbeck

    Problem with Persits ASPUpload

    John Rebbeck, Jul 11, 2003, in forum: ASP General
    Replies:
    3
    Views:
    171
    John Rebbeck
    Jul 14, 2003
  3. Serpico

    Persits PDF Expert Needed.

    Serpico, Feb 11, 2006, in forum: ASP General
    Replies:
    0
    Views:
    245
    Serpico
    Feb 11, 2006
  4. .Net Sports

    Persits.upload problem

    .Net Sports, Dec 13, 2007, in forum: ASP General
    Replies:
    0
    Views:
    164
    .Net Sports
    Dec 13, 2007
  5. .Net Sports

    Persits.Upload "cannot find file" error

    .Net Sports, Dec 17, 2007, in forum: ASP General
    Replies:
    1
    Views:
    139
    Mike Brind
    Dec 17, 2007
Loading...

Share This Page