Passing variables when using enctype="multipart/form-data">

Discussion in 'ASP General' started by Steven K, Feb 23, 2004.

  1. Steven K

    Steven K Guest

    Hello,

    I am using an asp page (upload.asp) to gather information and to upload
    files to the web server using SoftArtisans SAUpload Tool. In the first page
    (upload.asp), I have a form for gathering info with the following:

    <form method="POST" action="upload_ok.asp" name="frmUpload"
    enctype="multipart/form-data">
    <input type="hidden" name="cmdSearch" value="SearchValue">
    <input type="hidden" name="cmdName" value="NameValue">

    The problem I am having is that when I use [
    enctype="multipart/form-data" ], the second form (upload_ok.asp), is not
    picking up any of my form variables, or the first form (upload.asp) is not
    sending them (cmdSearch or cmdName). If I remove the [
    enctype="multipart/form-data" ] from the form in "upload.asp" then the
    second form (upload_ok.asp) will get the variables.

    Any help with this would be greatly appreciated...

    --
    Thanks in advance,

    Steven
     
    Steven K, Feb 23, 2004
    #1
    1. Advertising

  2. Steven K

    Ray at Guest

    What component are you using to handle the upload? That component should
    have a form collection, and you can get the other form values from it. The
    syntax will be determined by what component you're using. It will often be
    something along the lines of:

    Set yourUploadComponent = CreateObject("Your.UploadComponentClassString")
    sFormValue = yourUploadComponent.Form.Item("txtName").Value

    or something like that. It should be covered in the documentation for your
    component.

    --

    Ray at home
    Microsoft ASP MVP


    "Steven K" <> wrote in message
    news:OPYiuSm%...
    > Hello,
    >
    > I am using an asp page (upload.asp) to gather information and to upload
    > files to the web server using SoftArtisans SAUpload Tool. In the first

    page
    > (upload.asp), I have a form for gathering info with the following:
    >
    > <form method="POST" action="upload_ok.asp" name="frmUpload"
    > enctype="multipart/form-data">
    > <input type="hidden" name="cmdSearch" value="SearchValue">
    > <input type="hidden" name="cmdName" value="NameValue">
    >
    > The problem I am having is that when I use [
    > enctype="multipart/form-data" ], the second form (upload_ok.asp), is not
    > picking up any of my form variables, or the first form (upload.asp) is not
    > sending them (cmdSearch or cmdName). If I remove the [
    > enctype="multipart/form-data" ] from the form in "upload.asp" then the
    > second form (upload_ok.asp) will get the variables.
    >
    > Any help with this would be greatly appreciated...
    >
    > --
    > Thanks in advance,
    >
    > Steven
    >
    >
     
    Ray at, Feb 23, 2004
    #2
    1. Advertising

  3. Steven K

    Roland Hall Guest

    "Steven K" wrote:
    : I am using an asp page (upload.asp) to gather information and to upload
    : files to the web server using SoftArtisans SAUpload Tool. In the first
    page
    : (upload.asp), I have a form for gathering info with the following:
    :
    : <form method="POST" action="upload_ok.asp" name="frmUpload"
    : enctype="multipart/form-data">
    : <input type="hidden" name="cmdSearch" value="SearchValue">
    : <input type="hidden" name="cmdName" value="NameValue">
    :
    : The problem I am having is that when I use [
    : enctype="multipart/form-data" ], the second form (upload_ok.asp), is not
    : picking up any of my form variables, or the first form (upload.asp) is not
    : sending them (cmdSearch or cmdName). If I remove the [
    : enctype="multipart/form-data" ] from the form in "upload.asp" then the
    : second form (upload_ok.asp) will get the variables.

    Looking in FileUp 5 docs, I see this:
    When using an HTML form to upload files, the form submitting the file must
    contain:

    a.. The <form> tag attribute enctype="multipart/form-data".
    b.. An <input type="file"> tag, including a name attribute.
    http://support.softartisans.com/default.aspx?pageID=95


    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Feb 24, 2004
    #3
  4. "Steven K" <> wrote in message news:<OPYiuSm#>...
    If I remove the [
    > enctype="multipart/form-data" ] from the form in "upload.asp" then the
    > second form (upload_ok.asp) will get the variables.
    >


    Steven, I suspect that you're trying to use the ASP Request.Form
    collection to access form variables. You can't do that when the
    enctype is "multipart/form-data". To access form values use FileUp's
    Form collection instead:

    Instead of:

    Request.Form("name")

    Use:

    FileUpObj.Form("name")

    -chris
     
    Chris Baldwin, Mar 1, 2004
    #4
    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. Matt
    Replies:
    8
    Views:
    144,566
    zeeshanakhter2009
    May 26, 2012
  2. Duncan
    Replies:
    0
    Views:
    1,522
    Duncan
    Feb 24, 2006
  3. Matt
    Replies:
    1
    Views:
    11,294
    David Dorward
    Oct 12, 2004
  4. David Lozzi

    Using <form ... enctype="multipart/form-data">

    David Lozzi, Aug 12, 2003, in forum: ASP General
    Replies:
    5
    Views:
    361
    Martin CLAVREUIL
    Aug 12, 2003
  5. Kevin DeValck
    Replies:
    1
    Views:
    779
    7stud --
    May 17, 2011
Loading...

Share This Page