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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:33:28+00:00 2026-06-05T01:33:28+00:00

How to get a DataPart from MultipartFormData? I could not find any API to

  • 0

How to get a DataPart from MultipartFormData? I could not find any API to get that.

Http.MultipartFormData formData = body.asMultipartFormData();

// simple form field
// there is NO getData() or something available
DataPart imageIdPart = formData.getData("dataKey");

// uploaded file
FilePart imagePart = formData.getFile("imageKey");
  • 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-05T01:33:29+00:00Added an answer on June 5, 2026 at 1:33 am

    I’m not used to work with Java in Play 2.0, but is something like that working ?

    @BodyParser.Of(BodyParser.MultipartFormData.class)
    public static Result index() {
        Http.MultipartFormData multipartFormData = request().body().asMultipartFormData();
    
        //ask the multipart to be form url encoded... 
        //and get the data
        String[] data = multipartFormData.asFormUrlEncoded().get("dataKey");
    
        //which should not impact such call
        Http.MultipartFormData.FilePart image = multipartFormData.getFile("imageKey");
    
        return ok("Got image: " + image.getFilename());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Get sunrise time and sun set times from xml from web. This is the
i get the raw image data of a png-image from a webserver, and want
I am trying to get a Minimun price from a car in a table
I would like to get the sum of a column from database but the
I've been trying to get this really simple example of using AJAX with JQuery
Question on ODBC functions: I need to get the ISO 8601 calendar week from
I only want to get dates from the current year, and the year previous.
hI, I'm trying to get this code from Larry Nyhoff's book to compile in
I am trying to display JSON data that I retrieve from an ajax call
I am working on a sql view that should get the average number of

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.