private void fileUpload(final DataPacket<AFile> dp, Object[] args){
		/*
		 * Get some information out of data packet
		 */
		
		AFile recvAfile = dp.getContent();
		
		byte[] filecontent =  recvAfile.getFile();
		
		Log fileLog = dp.getLog();
		
		byte[] logToByte = recvAfile.getEditInfo().getBytes();
		
		PublicKey clientPK = CryptoKit.getPublicKey(fileLog.getidentity());
		
		/*
		 * verify success
		 */
		if(clientPK != null && CryptoKit.verifyWithRSA(TransformKit.byteMerger(filecontent, logToByte), 
									recvAfile.getSignature(), 
									clientPK)) {
			System.out.println("file recv, verify success");
			String fileName = recvAfile.getName();
			
			File createFile = new File(filePath + fileName);
			File createLog = new File(filePath + fileName + ".log");
			
			try {
				/*
				 * create real file
				 */
				createFile.createNewFile();
				
				/*
				 * create .log file
				 */
				createLog.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
			
			try {
				/*
				 * write .log file
				 */
				
				/*
				 *	xxx.log format is like getEditInfo() | signature()
				 */
				String logContent = recvAfile.getEditInfo() + "|" + TransformKit.bytes2HexString(recvAfile.getSignature());
				FileKit.write(logContent.getBytes(), createLog);
				/*
				 * write real file 
				 */
				FileKit.write(filecontent, createFile);
			} catch (IOException e) {
				e.printStackTrace();
			}
			
			/*
			 *  check file's name are in the file list or not;
			 *  if not, then add it
			 *  if it is in, then do nothing
			 */
			if(!fileList.contains(createFile)){
				fileListLock.lock();
				try{
					fileList.add(createFile);
				}
				finally{
					fileListLock.unlock();
				}
			}
			
			/*
			 * add this operation into operation Log
			 */
			XMLHelper xhelper = new XMLHelper(operationLogPath, operationLogRoot);
			try {
				xhelper.addlog(dp.getLog());
			} catch (Exception e) {
				e.printStackTrace();
			}
			
			broadcastMessage(recvAfile.getp2pMessages(), args, dp.getSenderIP());
		}
		
		/*
		 * is verify is failed,then send a failed datapacket back
		 */
		else{
			System.out.println(fileLog.getidentity() + "(" + dp.getSenderIP() + ") tries to upload a file, "
					+ "but signature is not valid.");
			final DataPacket<String> returndp = new DataPacket<String>(myIP, String.class, OperationType.fileOpFail);
			returndp.setContent("[Error from server] Signature verification failed");
			final String clientIP = dp.getSenderIP();
			
			(new Thread() {
				public void run() {
					try {
						IHost senderStub = getStub(clientIP);
						if (senderStub != null)
							senderStub.transferData(returndp);
					} catch (Exception e) {
						e.printStackTrace();
					}
				}
			}).start();
		}
	}