| | |
| | | |
| | | //文件全路径 |
| | | String fileName = fileDirName + File.separator + uName + ".jpg"; |
| | | |
| | | FileOutputStream fot=null; |
| | | try { |
| | | FileOutputStream fot = new FileOutputStream(fileName); |
| | | |
| | | fot = new FileOutputStream(fileName); |
| | | fot.write(dataBytes); |
| | | fot.flush(); |
| | | fot.close(); |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | if(fot!=null){ |
| | | try { |
| | | fot.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /*=========数据库表更新===========*/ |
| | |
| | | |
| | | //文件全路径 |
| | | String fileName = fileDirName + File.separator + uName + ".jpg"; |
| | | |
| | | FileOutputStream fot =null; |
| | | try { |
| | | FileOutputStream fot = new FileOutputStream(fileName); |
| | | |
| | | fot = new FileOutputStream(fileName); |
| | | fot.write(dataBytes); |
| | | fot.flush(); |
| | | fot.close(); |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | if(fot!=null){ |
| | | try { |
| | | fot.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return new Response().setII(1,"更新成功"); |
| | | } |