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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:41:15+00:00 2026-05-15T23:41:15+00:00

I have a requirement in which i need to process few data to generate

  • 0

I have a requirement in which i need to process few data to generate a Id field and at the same time i need to upload a few images which needs to be done at the press of a single button.I mean to say both the data and image have to be processed(image uploaded in file server and data saved in database)at the same time.I am using apache commons to upload the files and in the process i have set the form type as multipart.The problem is I have a few parameters set in the request itself whch when extracted in the servlet are returning null.Please provide me some pointers as to how can i extract these parameters set in request in the servlet.Please help me ..

  • 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-15T23:41:16+00:00Added an answer on May 15, 2026 at 11:41 pm

    Something like this helps you to extract the content :

    DiskFileItemFactory factory = new DiskFileItemFactory();
    ServletFileUpload fileUpload = new ServletFileUpload(factory);
    List<FileItem> fileUploadItems = fileUpload.parseRequest((HttpServletRequest) request);
    for (FileItem fileItem : fileUploadItems) {
        String fieldName = fileItem.getFieldName();
        String contentType = fileItem.getContentType();
        long size = fileItem.getSize();
        if (size < 1) {
            throw new FileUploadException("The submitted file must not be null!");
        }
        boolean equalFieldName = fieldName.equals(SOME_FIELD_NAME);
        if (!equalFieldName) {
            // do something
        }
        boolean equalContentType = contentType.equals(SOME_CONTENT);
        if (!equalContentType) {
            // do something
        }
        if (equalFieldName && equalContentType) {
             stream = fileItem.getInputStream();
             break;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a requirement in which we need to change change the words or
I have what seems to be a fairly common inter-process communication requirement - a
I have a web application in Spring that has a functional requirement for generating
I have a third party encryption library, which may create a MessageBox if key
In my application I need to push notifications of real time events from server
I have a question that doesn't need any specific answer, just a general direction
I have a requirement to build features that perform certain background tasks on a
I have this java application and ran into a requirement to parse an STDF.
I am writing a script on which the user needs to be able to
I have a table in a central database that gets constantly appended to. I

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.