[svn r12379] Fix the picture upload bug in http://projects.dokeos.com/?do=details&id=1506

skala
Julian Prud'homme 18 years ago
parent 286e5f4ab0
commit 253a0b2cf0
  1. 5
      main/admin/user_add.php

@ -1,4 +1,4 @@
<?php // $Id: user_add.php 12274 2007-05-03 14:58:36Z yannoo $
<?php // $Id: user_add.php 12379 2007-05-11 09:16:27Z elixir_julian $
/*
==============================================================================
Dokeos - elearning and course management software
@ -169,6 +169,9 @@ if( $form->validate())
$picture_uri = '';
if (strlen($picture['name']) > 0)
{
if(!is_dir(api_get_path(SYS_CODE_PATH).'upload/users/')){
mkdir(api_get_path(SYS_CODE_PATH).'upload/users/', 0777);
}
$picture_uri = uniqid('').'_'.replace_dangerous_char($picture['name']);
$picture_location = api_get_path(SYS_CODE_PATH).'upload/users/'.$picture_uri;
move_uploaded_file($picture['tmp_name'], $picture_location);

Loading…
Cancel
Save