Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8316017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:15:42+00:00 2026-06-08T21:15:42+00:00

so I have a slight issue with doing 2 things on a web page.

  • 0

so I have a slight issue with doing 2 things on a web page. I’m using a to upload a file to my web server, at the same time I have other used to get data from the user (first name, last name ect) The form is runat=server, the button that is supposed to upload the file (after some preliminary checking that the file is ok, and that the forms fields are filled out properly) is also runat server, with a onserver click.

The main issue is that, when I give the form a “get” method, I can get the desired result of having all my data in the url where I want it, but then I can’t upload a file. While if I remove that tag, I can upload a file, but then I get no data in my url.

(Relevant code)

    <script language="VB" runat="server">
        Dim str As String
        Sub Button1_Click(ByVal Source As Object, ByVal e As EventArgs)

            'Dim submitFunction As String = "<script type='text/javascript'> function submitform() { document.myform.submit();}" & "</" & "script>"
            Session("firstTime") = 4
            Session("errCheck") = 1
            If InputF.Value = "" Then
                Span1.InnerHtml = "Error: you must enter a file name"
                Return
            End If

            If Not (InputF.PostedFile Is Nothing) Then
                Try
                    If Session("firstTime") <> 1 Then

                        If Request.QueryString("fName") = "" Then
                            str += "Please Enter your first name <br/>"
                            Session("errCheck") += 1
                        End If
                        If Request.QueryString("lName") = "" Then
                            str += "Please Enter your last name <br />"
                            Session("errCheck") += 1
                        End If
                        If Request.QueryString("addr1") = "" Then
                            str += "Please Enter your address <br />"
                            Session("errCheck") += 1
                        End If
                        If Request.QueryString("city") = "" Then
                            str += "Please Enter a city name <br />"
                            Session("errCheck") += 1
                        End If
                        If Len(Request.QueryString("prov")) <> 2 Then
                            str += "Please Enter a 2 character province <br />"
                            Session("errCheck") += 1
                        End If
                        If Len(Request.QueryString("pCode")) <> 6 Then
                            str += "Please Enter a valid postal code <br />"
                            Session("errCheck") += 1
                        End If
                        If Request.QueryString("hPhone") = "" Then
                            str += "Please Enter your home phone <br />"
                            Session("errCheck") += 1
                        ElseIf Len(Request.QueryString("hPhone")) <> 10 Then
                            str += "Please enter a 10 digit number for your home phone <br />"
                            Session("errCheck") += 1
                        End If
                    End If
                    If Session("errCheck") = 1 Then
                        InputF.PostedFile.SaveAs(("FILE PATH TO MY SERVER" & Request.QueryString("compName") & " - " & Request.QueryString("fName") & ", " & Request.QueryString("lName") & InputF.Value))
                        'Response.Redirect("default.aspx?fName=" & Request.QueryString("fName"))
                    End If

                Catch exc As Exception
                    str += "Error Saving File"
                    Span1.InnerHtml = "Error saving file"
                    Session("errCheck") += 1
                End Try

            End If

        End Sub 'Button1_Click 

</script>


                    <form  name="myform" id="myform" method="get" runat="server" enctype="multipart/form-data">
                    <table>
                        <h2><%  If Session("errCheck") <> 1 Then
                                    Response.Write(Str)
                                End If%></h2>
                        <tr>
                            <td align="right"><label>Resume/Documents</label></td>
                            <td><input type="file" runat="server" id="InputF" name="InputF" onchange="handleFiles(this.files)" /><input type="button" id="adder" value="add another document" onclick="addInput('dynamicInput');" /></td>
                            <div id="dynamicInput">
                            </div>
                        </tr>
                        <tr>
                            <td>                
                                <span id=Span1 
                                style="font: 8pt verdana;" 
                                runat="server" />
                            </td>
                        </tr>
                    <input type="hidden" id="Hidden13" name="compName" value="<% response.Write(request.QueryString("compName")) %>" />
                    <input type="hidden" id="posCode" name="posCode" value="<% response.Write(request.QueryString("posCode"))%>" />
                    <input type="hidden" id="reqNum" name="reqNum" value="<% response.Write(request.QueryString("reqNum")) %>" />
                    <input type="hidden" id="company" name="company" value="<% response.Write(request.QueryString("company"))%>" />
                    <input type="hidden" id="division" name="division" value="<% response.Write(request.QueryString("division")) %>" />
                    <input type="hidden" id="department" name="department" value="<% response.Write(request.QueryString("department"))%>" />
                        <tr>
                            <td align="right">First name<span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='fName' id='fName'  size='50'  maxlength="50"value="<% Response.Write(Request.QueryString("fName"))%>" /></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Last name </label><span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='lName' id='lName'  size='50'  maxlength="50" value="<% response.Write(request.QueryString("lName"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Initial</label>:</td>
                            <td><input type='text' name='init' id='init'  size='2'  maxlength="2" value="<% response.Write(request.QueryString("init"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Email</label>:</td>
                            <td><input type='text' name='email' id='email'  size='50' maxlength="50" value="<% response.Write(request.QueryString("email"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Address 1</label><span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='addr1' id='addr1'  size='25' maxlength="25" value="<% response.Write(request.QueryString("addr1"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Address 2</label>:</td>
                            <td><input type='text' name='addr2' id='addr2'  size='25' maxlength="25" value="<% response.Write(request.QueryString("addr2"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>City</label><span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='city' id='city'  size='25' maxlength="25" value="<% response.Write(request.QueryString("city"))%>"/></td>
                        </tr>
                        <br />
                        <tr>
                            <td align="right"><label>Province</label><span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='prov' id='prov'  size='2' maxlength="2" value="<% response.Write(request.QueryString("prov"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Country</label>:</td>
                            <td><input type='text' name='count' id='count'  size='25' maxlength="25" value="<% response.Write(request.QueryString("count"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Postal code</label><span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='pCode' id='pCode'  size='25' maxlength="25" value="<% response.Write(request.QueryString("pCode"))%>"/></td>
                        </tr>
                        <tr>
                            <td align="right"><label>Home Phone</label><span style="color:Red;">*</span>:</td>
                            <td><input type='text' name='hPhone' id='hPhone'  size='15' maxlength="15" value="<% response.Write(request.QueryString("hPhone"))%>"/></td>
                            <p>Format for phone numbers: Areacode, phone number, no spaces, no dashes ie: 2041231234</P>
                        </tr>
                        <tr>
                            <td align="right"><label>Work Phone</label>:</td>
                            <td><input type='text' name='wPhone' id='wPhone'  size='25' maxlength="25" value="<% response.Write(request.QueryString("wPhone"))%>"/></td>
                        </tr>
                    </table>
                           <input type=button 
                            id="Button1" 
                            value="Submit Application" 
                            OnServerClick="Button1_Click" 
                            runat="server" />
                </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:15:43+00:00Added an answer on June 8, 2026 at 9:15 pm

    I was close to getting this myself. On form submit, I do all the validation for the other files, then if all checks out, I submit the form to a different page(with other non-relevant code).

    Basically the code I posted is good, I was just missing a few things for when it’s submitted

    In short:

    'if there are no errors with the user feilds
    If Session("errCheck") = 1 Then
                        Try
                        If Not (System.IO.Path.GetFileName(InputF.PostedFile.FileName.ToString()) Is Nothing) Then
                            Try
                                InputF.PostedFile.SaveAs(("somepath:\somepath\somepath\somepath\" & Trim(Request.Form("compName")) & " - " & Request.Form("lName") & ", " & Request.Form("fName") & "-" & System.IO.Path.GetFileName(InputF.PostedFile.FileName.ToString())))
                            Catch ex As Exception
                                Session("errCheck") += 1
                                str += "Error Saving File" & ex.Message
                            End Try
    If Session("errCheck") = 1 Then
                            Response.Redirect("final2.aspx?fName=" & Request.Form("fName") & "&lName=" & Request.Form("lName") & "&compName=" & Trim(Request.Form("compName")) &
                            "&posCode=" & Request.Form("posCode") & "&reqNum=" & Request.Form("reqNum") & "&company=" & Request.Form("company") & 
                            "&division=" & Request.Form("division") & "&department=" & Request.Form("department") & "&init=" & Request.Form("init") & 
                            "&email=" & Request.Form("email") & "&addr1=" & Trim(Request.Form("addr1")) & "&addr2=" & Request.Form("addr2") & 
                            "&city=" & Request.Form("city") & "&prov=" & Request.Form("prov") & "&count=" & Request.Form("count") & 
                            "&pCode=" & Request.Form("pCode") & "&hPhone=" & Request.Form("hPhone") & "&wPhone=" & Request.Form("wPhone"))
                        End If
    

    Hopefully that makes sense to anyone looking at my question and now my answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all: I'm at Scala 2.8 I have a slight issue while using
I have a slight issue when i get content using ajax. The issue is
I have a slight issue where I can't seem to select a User Control
Having a slight Javascript issue at the moment, I am hoping to have the
I have a slight issue with some code I'm writing if(parameter == 1) {
I have a slight issue I'm trying to find the best solution for. I
I have a slight issue that someone might be able to point me in
I have a slight issue in my C# code in Asp.net when deleting a
I have a slight issue with parsing data in an array from PHP to
I'm creating a trigger in MySQL but have a slight issue. Here's the trigger

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.