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

  • Home
  • SEARCH
  • 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 8493557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:02:54+00:00 2026-06-10T23:02:54+00:00

Hi I have am trying to implement a file upload in my application where

  • 0

Hi I have am trying to implement a file upload in my application where the file uploaded is parsed and an entry is created in the database using that information.

 def save = {

        def file = request.getFile("file");
        def filename = file.getOriginalFilename();
        def type = filename.split('\\.');

        if(!file.isEmpty()){
            if(type[1] == "properties"){

                redirect(action:"parsePropertyFile", params:params);
            }
        }
 }

def parsePropertyFile = {

      println "\n"
      println params.file;
      println "\n";

      def f = params.file;
      println f;

      def filename = f.getOriginalFilename();
      println filename;
}

when I print out f this is output:

org.springframework.web.multipart.commons.CommonsMultipartFile@29d32df9

but when I try to call getOriginalFilename() on f I get the following error:

groovy.lang.MissingMethodException: No signature of method: 
java.lang.String.getOriginalFilename() is applicable for argument types: () values: []

I also printed out file from the save function and the output of that is also:

org.springframework.web.multipart.commons.CommonsMultipartFile@29d32df9

so why am I getting the error?

  • 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-10T23:02:56+00:00Added an answer on June 10, 2026 at 11:02 pm

    Instead of redirecting, can you just call your another function? Redirect will issue an http redirect with the file as param with no need.

    if(type[1] == "properties") {
      parsePropertyFile(file)
    }
    

    And then:

    private def parsePropertyFile(def file) {
      String filename = file.getOriginalFilename();
      ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement file upload functionality on my site. I have created
I have an application where I am trying to implement a safe file overwrite
I am trying to implement vectorization of a text file...I have created a dictionary
I'm trying to implement jQuery-File-Upload - I have it working when I drag &
I am trying to implement file upload/download via a javascript application written with Backbone.js
I am trying to implement a file upload to a pre-existing form that I
Good Evening, I have been trying to implement a simple Android(tm) application that utilizes
I am trying to implement a RESTful API in which I have to upload
Background I'm trying to implement block file locking in my C# application. The built-in
I'm trying to implement file upload functionality in the iPhone app. Server code is

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.