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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:10:06+00:00 2026-06-16T07:10:06+00:00

I am trying to upload multiple files from jsp using below code: When I

  • 0

I am trying to upload multiple files from jsp using below code:

When I execute it from my local machine I am able to upload in the local systems folder.
But when I access the same from remote machine I am expecting that the files should be uploaded to the same machine where my tomcat exist ,but I get error C:\Files\`folder/file not found`.
Please guide.How to upload it in remote machine or where the tomcat resides

boolean isMultipart = ServletFileUpload.isMultipartContent(request);
     if (!isMultipart) {
     } else {
               FileItemFactory factory = new DiskFileItemFactory();
               ServletFileUpload upload = new ServletFileUpload(factory);
               List items = null;
               try {
                       items = upload.parseRequest(request);
               } catch (FileUploadException e) {
                       e.printStackTrace();
               }
               Iterator itr = items.iterator();
               while (itr.hasNext()) {
               FileItem item = (FileItem) itr.next();
               if (item.isFormField()) {
               } else {
                       try {
                               String itemName = item.getName();
                               File savedFile = new File("C:\\Files\\a.tiff");
                               item.write(savedFile);  

                       } catch (Exception e) {
                               e.printStackTrace();
                       }
               }
               }
       }

This is the path where I want to upload all files C:\\Files\\ of the machine where tomcat is.

  • 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-16T07:10:07+00:00Added an answer on June 16, 2026 at 7:10 am

    Change your file save path to new File("C:\\Files\\"); . Even, still you have any problem, then create one folder with Files name in another drive E or F whatever and change your code like new File("E:\\Files\\"); if you wanna save your file to E drive.

    Note: Since, C drive is the primary drive in windows OS, so due to lack of permission, it won’t allow to create new file/folder in that drive. So, please try the alternative solution. I mean try to change your file location.

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

Sidebar

Related Questions

I am using Codeigniter and I am trying to upload multiple files into a
I am trying to upload some files using the multiple upload file field. The
I am trying to load multiple files using HTML5. This is my code I
I am trying to write a PHP script that can upload multiple files. for($i=0;$i<count($_FILES['uploadimg']['name']);$i++){
I'm trying to upload files to the blobstore in my Google App without using
I'm trying to upload multiple files at once but have a solo form field
I'm trying to a upload file (or multiple files) to my servlet, which is
i have this code that submits multiple files and titles im trying to combine
I am trying to upload multiple files but when i select more than 1
I'm having problems trying to upload files using the latest XHR 2 along with

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.