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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:01:53+00:00 2026-06-13T15:01:53+00:00

I need to store cad files on my server, but I can’t get the

  • 0

I need to store cad files on my server, but I can’t get the upload to work. I tried to get this working for hours but I just can’t. Atm I have this.
This gives me an error that

random number.temp doesn’t exist ( java.io.FileNotFoundException: /home/nick/.netbeans/7.1.2/config/GF3_1/domain1/generated/jsp/lrt/upload_700679fb_13a96c78523__7ffb_00000006.tmp (No such file or directory )

package Admin;

import java.io.IOexception;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Collection;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;

@WebServlet(name = "UploadServlet", urlPatterns = {"/UploadServlet"})
@MultipartConfig
public class UploadServlet extends HttpServlet {

    @Override
     protected void doPost(HttpServletRequest request, 
       HttpServletResponse responst) throws ServletException, IOException {
      Collection<Part> parts = request.getParts();
      if (parts.size() != 3) {
         //can write error page saying all details are not entered
      }
       Part filePart = request.getPart("cad");
       InputStream sInputStream = filePart.getInputStream();
       //read imageInputStream
       filePart.write(filePart.getName());
       //Read Name, String Type 
       Part namePart = request.getPart("cad");
       if(namePart.getSize() > 20){
           //write name cannot exceed 20 chars
       }
       //use nameInputStream if required        
       InputStream nameInputStream = namePart.getInputStream();
       //name , String type can also obtained using Request parameter 
       String nameParameter = request.getParameter("name");
       //Similarly can read age properties
       Part agePart = request.getPart("age");
       int ageParameter = Integer.parseInt(request.getParameter("age"));
    }

    @Override
    public String getServletInfo() {
        return "Short description";
    }
}
  • 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-13T15:01:54+00:00Added an answer on June 13, 2026 at 3:01 pm

    The temporary file representing the uploaded file could not be found.

    The path indicates that it’s stored in Glassfish work folder in Netbeans project folder. Perhaps there’s some agressive cleanup/hotdeploy going on inside Netbeans and the temporary file was been swept too soon? Or perhaps there are just insufficient write rights? That depends on the context of how and where the exception is been thrown — which isn’t clear from your question.

    To start, I’d suggest telling @MultipartConfig to store the temp files in a different, a bit more permanent and writable, location. For example,

    @MultipartConfig(location="/var/webapp/temp")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get pointer to my class instance inside this instance. I can't
I've some issue. I need store a functions into the Map but this functions
Need to store some data in SQLite. To work with SQLite chose UniDac, but
I need store just 10 arrays in my app, which I can change from
I need to store user credentials in my app. I can store and retrieve
I need to store locally on android devices some images I get from the
We need to store binary files (mostly MS Word documents, ranging from a couple
I'm working on a webapp where I need store references to YouTube videos in
I need to store the content of a site that can be in any
I need to store very large (more than 512Mb) binary files into a NoSQL

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.