MultiPartRequestWrapper multipartRequest = (MultiPartRequestWrapper) getRequest();
File[] file
= multipartRequest.getFiles("file");// 获得文件
String[] filenames = multipartRequest.getFileNames("file");
for (int i = 0; i < filenames.length; i++){
  File f1
= file[i];
  
byte[] fileArray = org.springframework.util.FileCopyUtils.copyToByteArray(f1);
  JlsPhotos jlsPhotos
=new JlsPhotos();
  jlsPhotos.setPhoto(Hibernate.createBlob(fileArray));
  jlsPhotosManager.save(jlsPhotos);
}
ext前台代码
Ext.apply(this,{
fileUpload:
true,

items:[{
{
xtype :
'textfield',
fieldLabel:
'选择正面照片',
name :
'file',
width:
'300',
inputType:
'file'
}

相关文章:

  • 2021-09-20
  • 2021-10-17
  • 2017-11-22
  • 2021-08-21
  • 2021-11-05
  • 2021-11-17
  • 2021-09-21
  • 2021-04-25
猜你喜欢
  • 2021-12-24
  • 2021-11-28
  • 2021-12-21
  • 2021-12-22
  • 2021-11-07
  • 2021-09-08
  • 2021-11-06
  • 2021-11-17
相关资源
相似解决方案