Interface FormFile实用说明

文件的上传的说明

方法摘要说明

void destroy()销毁所有内容为上传的文件,包括任何潜在的数据文件。

java.lang.String getContentType()返回的内容类型为这个数据文件。

byte[] getFileData()传回的数据为整个文件作为字节数组。

java.lang.String getFileName()传回的数据文件名称,这个数据文件。

int getFileSize() 返回数据文件的大小

java.io.InputStream getInputStream()返回一个输入流此数据文件。

void setContentType(java.lang.String contentType)这个数据文件位集合的数据类型
void setFileName(java.lang.String fileName)返回的集合的数据文件名称
void setFileSize(int fileSize)设置文件的大小


getContentType
public java.lang.String getContentType()
返回的内容类型为这个档案。
Returns:
A String representing content type.

setContentType
public void setContentType(java.lang.String contentType)
Parameters:
contentType - The content type for the file.

getFileSize
public int getFileSize()
Returns:
The size of the file, in bytes.
--------------------------------------------------------------------------------
setFileSize
public void setFileSize(int fileSize)
Parameters:
fileSize - The size of the file, in bytes,
--------------------------------------------------------------------------------

getFileName
public java.lang.String getFileName()Returns the file name of this file.
This is the base name of the file, as supplied by the user when the file was uploaded.
Returns:
The base file name.
--------------------------------------------------------------------------------
setFileName
public void setFileName(java.lang.String fileName)Sets the file name of this file.
Parameters:
fileName - The base file name.

--------------------------------------------------------------------------------
getFileData
public byte[] getFileData() throws java.io.FileNotFoundException,
java.io.IOException
Returns:
The file data as a byte array.
Throws:
java.io.FileNotFoundException - if the uploaded file is not found.
java.io.IOException - if an error occurred while reading the file.
--------------------------------------------------------------------------------
getInputStream
public java.io.InputStream getInputStream() throws java.io.FileNotFoundException,
java.io.IOException
Throws:
java.io.FileNotFoundException - if the uploaded file is not found.
java.io.IOException - if an error occurred while reading the file.
--------------------------------------------------------------------------------
destroy
public void destroy()Destroys all content for the uploaded file, including any underlying data files.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值