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 1047217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:16:00+00:00 2026-05-16T16:16:00+00:00

I have created two JSP programs as follows. First One: Addmulti.jsp <html> <head><title>Upload Excel

  • 0

I have created two JSP programs as follows.

First One: Addmulti.jsp

<html>
<head><title>Upload Excel File</title></head></p> <p><body>
<form action="Test2.jsp" method="post" enctype="multipart/form-data" name="form1" id="form1">
<br><br>
Upload File:
<input name="file" type="file" id="file"><br><br>
<input type="submit" name="Submit" value="Submit"/><br><br>
<input type="reset" name="Reset" value="Reset"/>
</form>
</body>
</html>

Second one: Test2.jsp

<%@ page import="myfirst.*" %>
<%

String filevar=request.getParameter("file");
String result="";
myfirst.SearchLink z=new myfirst.SearchLink();
result=z.addmultiple(filevar);
System.out.println(result);
out.println(result);
%>

SearchLink is a java program which contains the method as below,

public String addmultiple(String file)throws SQLException{
        return file;
}

I want the complete path of the file that is selected in the first jsp program mentioned above to be transmitted to the java method named addmultiple(String). Instead, null is getting printed in the browser as output once the Test2.jsp program is called.

What actually will be passed to the method with the parameter String in the code described above?

How to send the complete path of the file that is selected in the first jsp code to the java program? Please advise.

  • 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-05-16T16:16:01+00:00Added an answer on May 16, 2026 at 4:16 pm

    You can’t.

    First, request.getParameter() will always return null in multipart/form-data requests. You need to parse the request body. How to do this is answered and commented in your previous question.

    Second, the webbrowser is supposed to send only the file name along the file content. MSIE is the only webbrowser which (incorrectly) sends the full path along the name. You should not be relying on that. You should also not be interested in the file path. What can you do with it? Open a file using java.io.File or so? How would you get that to work when webbrowser and webserver runs at physically different machines?

    See also:

    • How to upload files in JSP/Servlet
    • How to get file path from HTML input form in Firefox
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created two JavaScript files. One file is "validators.js" and the other is
fI have created two layout files. First one is main.xml <?xml version=1.0 encoding=utf-8?> <LinearLayout
I currently have two files, register.html and register.jsp. The HTML file asks the user
I have created two DbContexts, one is for application configuration, the second is for
I have created two folders layout and layout-land with two xml files, one for
I have created two forms in my Windows Application. One Form acts as a
I have created two viewController classes such that one is superclass of another.i have
i have one login.jsp web page where i have two textboxes for username and
I have created two StringBuffer as follows StringBuffer buffer1 = new StringBuffer(Text); StringBuffer buffer2
I have created two imageViews promatically as shown below: public void createImageViews(Integer count){ ImageView[]

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.