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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:36:09+00:00 2026-05-26T14:36:09+00:00

I am trying to upload a CSV file to Oracle database from my client

  • 0

I am trying to upload a CSV file to Oracle database from my client machine using the URL, but I am not able to upload. When I try to upload from my PC (Server) it uploads easily but the same link when I try in my client PC, it is unable to upload. It is giving me the following exception:

java.io.FileNotFoundException: C:\new_upload\BD_RMA_25_10_11.csv (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at java.io.FileReader.<init>(FileReader.java:41)
at upload1.UploadOutOrder.service(UploadOutOrder.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)

This is my Servlet code:

    package upload1;   
    import java.io.BufferedReader; 
    import java.io.FileReader;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.util.StringTokenizer;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    public class UploadOutOrder extends HttpServlet {
        public void init(ServletConfig config) throws ServletException{
        super.init(config);
        System.out.println("The UploadOutOrder initiated.");
         }
        public void service(HttpServletRequest request, HttpServletResponse    response)         throws ServletException,IOException {
        String filecsv=request.getParameter("csvfile");
        Connection con=DBConnection1.getConnection();
        System.out.println("connection=----------->"+con);
        PreparedStatement pstmthdr=null;
        int rowshdr=0;
        BufferedReader brcsv=new BufferedReader(new FileReader(filecsv));
        System.out.println("reading the file");
        String strLineCsv="";
        String csvstr="";
        StringTokenizer stcsv=null;
        int lineNumberHdr=0;
        try{
            pstmthdr=con.prepareStatement("insert into Out_Table values (?)");
            System.out.println("statement executed");
            while((strLineCsv=brcsv.readLine())!=null){
                System.out.println("HEADERLINE"+strLineCsv);
                int i=1;
                if(!(lineNumberHdr==0)){
                    stcsv=new StringTokenizer(strLineCsv,",");
                    while(stcsv.hasMoreTokens()){
                        csvstr=stcsv.nextToken();
                        System.out.println("HeaderString: "+csvstr);
                        pstmthdr.setString(i++,csvstr);
                        System.out.println("below insertion");
                    }
                    rowshdr=pstmthdr.executeUpdate();
                    System.out.println(rowshdr+" rows updated.");
                }
                lineNumberHdr++;
            }
            System.out.println("not in detail");

            System.out.println("ps executed");

        }
        catch(Exception e){
            System.out.println(e.getMessage());
        }
        finally
        {
            try {
                con.close();
            } catch (SQLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        response.sendRedirect("http://ipaddress:8080/InvenApplication/success1.jsp");
    }
}

How is this problem caused and how can I solve it?

  • 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-26T14:36:09+00:00Added an answer on May 26, 2026 at 2:36 pm

    You were using MSIE browser which has a bug that it sends the absolute file path instead of alone the file name in an <input type="file">. You are in the server side grabbing the absolute file path as parameter and then using this to look for a file on the server side’s disk file system. This would obviously only work when both the webserver and webbrowser happen to run on physically the same machine.

    When the webserver runs on a physically different machine, then that absolute file path does not necessarily point to an existing file on the machine’s local disk file system. If it were possible that the server could access the client’s local disk file system by having just an absolute file path, then it would have been a huge security hole! Every website which you visit would then be able to leech/manipulate the disks of the website visitors! No, fortunately this isn’t possible.

    You should not be interested in the uploaded file’s absolute path as it is in the client side. You should rather be interested in the uploaded file’s content. To get the file’s content, you should ensure that the encoding type of the HTML <form> is set as follows:

    <form action="upload" method="post" enctype="multipart/form-data">
    

    This way you can use Apache Commons FileUpload in the servlet to get the file’s content as an InputStream. You can use InputStreamReader to decorate it into a Reader.

    See also:

    • How to upload files to server using JSP/Servlet? (contains complete code examples)
    • How to get the file path from HTML input form in Firefox 3 (related question)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to upload an image from a jsp page using servlet. but
I'm trying to upload this CSV file onto my table in pgsql, but I'm
I'm trying to upload a 95 GB CSV file into a MySQL database (MySQL
I am trying to import a .csv file into my database. I am able
I am trying to import a .csv file into my database. I am able
I´m trying to upload a file which is fetched from a server. But when
im trying to upload a file using org.apache.commons.fileupload. but i dont no, what mistake
I am trying to upload file using php. I am using the function move_uploaded_file.
I'm trying to upload a file using Watin and C#. Under Windows XP, Watin
I am trying to upload a file from a flash widget to my rails

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.