void UploadFile( HttpServletRequest request, HttpServletResponse response, String login )
	{
		json = new JSONObject();
		
		// Создаем фабрику для файлов хранимых на диске
		DiskFileItemFactory factory = new DiskFileItemFactory();
		
		// Настраиваем контейнер для хранения файлов
		File repository = new File(uploadPath);
		factory.setRepository(repository);
		
		// Создаем новый обработчик загрузки файла
		ServletFileUpload upload = new ServletFileUpload( factory );
		upload.setHeaderEncoding("UTF-8");
		
        //создаем слежку за прогрессом
        ProgressListener progressListener = new ProgressListener()
        {
        	   public void update(long pBytesRead, long pContentLength, int pItems) 
        	   {   
        	       if (pContentLength == -1) 
        	       {
        	           System.out.println("So far, " + pBytesRead + " bytes have been read.");
        	       } 
        	       else 
        	       {
        	    	   //высчитываем процен выполнения
        	    	   percent = (int) ( (int) pBytesRead/( pContentLength/100 ) );
        	    	   contentLength = pContentLength/1048576;
        	    	   bytesRead = pBytesRead/1048576;
        	       }
        	   }
        };
    	
        upload.setProgressListener(progressListener);
		
		//Парсим запрос
		try 
		{
			
			List<FileItem> items = upload.parseRequest( request );
			
			// Обрабатываем загруженные файлы
			Iterator<FileItem> iter = items.iterator();
			
			String fieldName = null;
			String fileName = null;
			String contentType;
			boolean isInMemory;
			long sizeInBytes = 0;
			FileItem item = null;
			String name = null;
			String days = null;
			FileItem uploadItem = null;
			
			while ( iter.hasNext() ) 
			{
			    item = iter.next();

			    if ( !item.isFormField() ) 
			    {
			        fieldName = item.getFieldName();
			        fileName = item.getName();
			        contentType = item.getContentType();
			        isInMemory = item.isInMemory();
			        sizeInBytes = item.getSize();	
			        uploadItem = item;
			        
			    } 
			    else 
			    {
			    	 name = item.getFieldName();
			    	 days = item.getString();
			    }
			}
				
			if ( uploadItem != null && fileName != null )
			{
				
				fileName = transliterator.transliterate(fileName);
				
				uploadItem.write( new File( uploadPath + new String( fileName.getBytes("UTF-8" ) ) ) );
		      
		        
		        int random = mysql.addFile(fileName, login, sizeInBytes, Integer.parseInt(days) );
		        
		        json.put( "result", random );
		        response.getWriter().print( json.toString() );
			}	
			else
			{
				json.put( "result", "error" );
		        response.getWriter().print( json.toString() );
			}
		} 
		catch (Exception e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}