This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

SpringMVC Unable to download file

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I am trying to download the file from UI, a part of the filename is truncated and I am unable to download the file. For example:- if the actual file name is "testscript.doc", while reading through the servletrequest getparameter method, the filename is truncated and I am getting the file name as "test.doc". Here the word "script" is missing from the file name.

This is happening only when I use "script" anywhere in the filename.

The UI part is  written in AngularJS and the background processing is through Java.

I have debugged using developer tools. I could see the actual file name for downloading but at the background processing (servlet) I could see a part of the filename truncated and unable to download the file.

The application is developed using SpringMVC framework.  For download logic, I am using Java Servlet and AngularJS. The application is hosted on the Tomcat server.

A part of the filename is truncated after the request is sent from UI due to which I am unable to download the file. Please help.

Code snippet






 
Bartender
Posts: 558
10
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i doubt the name is being truncated.  That input is probably coming from somewhere directly
reply
    Bookmark Topic Watch Topic
  • New Topic