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);
}
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.apply(this,{
fileUpload: true,
items:[{
{
xtype : 'textfield',
fieldLabel: '选择正面照片',
name : 'file',
width:'300',
inputType: 'file'
}
fileUpload: true,
items:[{
{
xtype : 'textfield',
fieldLabel: '选择正面照片',
name : 'file',
width:'300',
inputType: 'file'
}