[Java] Returns a Japanese name file in filename of HTTP header

When I tried to download Japanese_1.tsv, it turned out to be _1.tsv. URL encoding is required to download in Japanese

Example of embedding in Spark response header

    Spark.res.header("Content-disposition", "attachment; filename=Japanese_1.tsv")

You need to encode this and embed it

    Spark.res.header("Content-disposition", "attachment; filename=" + URLEncoder.encode("Japanese_1.tsv", "UTF-8"))

Recommended Posts

[Java] Returns a Japanese name file in filename of HTTP header
Sample program that returns the hash value of a file in Java
Get the public URL of a private Flickr file in Java
Create a TODO app in Java 7 Create Header
The story of forgetting to close a file in Java and failing
Read a string in a PDF file with Java
Deserialize CSV in Java based on header name
Measure the size of a folder in Java
A bat file that uses Java in windows
A quick review of Java learned in class
Method name of method chain in Java Builder + α
Get the URL of the HTTP redirect destination in Java
A quick review of Java learned in class part4
[Java] Get the file in the jar regardless of the environment
A quick review of Java learned in class part3
How to convert a file to a byte array in Java
A quick review of Java learned in class part2
Java11: Run Java code in a single file as is
A quick explanation of the five types of static in Java
[Java, stream] Sort object list in Japanese by property name
I tried to make a client of RESAS-API in Java
[Java] Create a temporary file
Find a subset in Java
Implementation of gzip in java
Implementation of tri-tree in Java
Let's create a TODO application in Java 4 Implementation of posting function
I can't create a Java class with a specific name in IntelliJ
Let's create a TODO application in Java 6 Implementation of search function
Handle business logic for a set of Entity in Java class
Let's create a TODO application in Java 8 Implementation of editing function
Fix the file name of war to the one set in Maven
Cast an array of Strings to a List of Integers in Java
Let's create a TODO application in Java 1 Brief explanation of MVC
Read items containing commas in a CSV file without splitting (Java)
Let's create a TODO application in Java 5 Switch the display of TODO
Overwrite upload of file with the same name with BOX SDK (java)
How to get the length of an audio file in java
Think of a Java update strategy
3 Implement a simple interpreter in Java
Read Java properties file in C #
I created a PDF in Java.
Upload a file using Java HttpURLConnection
Sort a List of Java objects
Run a batch file from Java
Unzip the zip file in Java
Log output to file in Java
A simple sample callback in Java
List of members added in Java 9
How to name variables in Java
A brief description of JAVA dependencies
About file copy processing in Java
Get stuck in a Java primer
List of types added in Java 9
Implementation of like function in Java
Dynamically increase the number of elements in a Java 2D array (multidimensional array)
To create a Zip file while grouping database search results in Java
Memo: [Java] If a file is in the monitored directory, process it.
How to get the absolute path of a directory running in Java
<Java> Quiz to batch convert file names separated by a specific character string with a part of the file name