Java File download

Posted irobotzz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java File download相关的知识,希望对你有一定的参考价值。

 
注意文件响应处理方式,是响应为网页形式还是附件显示,看如下信息:
 
 
In a regular HTTP response, the Content-Disposition response header is a header indicating if the content is expected to be displayed inline in the browser, that is, as a Web page or as part of a Web page, or as an attachment, that is downloaded and saved locally.

In a multipart/form-data body, the HTTP Content-Disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to. The subpart is delimited by the boundary defined in the Content-Type header. Used on the body itself, Content-Disposition has no effect.

The Content-Disposition header is defined in the larger context of MIME messages for e-mail, but only a subset of the possible parameters apply to HTTP forms and POST requests. Only the value form-data, as well as the optional directive name and filename, can be used in the HTTP context.

 

 

For more information check out here.

  

以上是关于Java File download的主要内容,如果未能解决你的问题,请参考以下文章

java file创建文件 转换为 MultipartFile

从 java.io.File 获取 java.nio.file.Path 对象

java io包File类

什么是 java.io.File.setWritable() 的 java.nio.file.Files 等价物?

File类(java.io.File)

Java IO流File类的使用