Bonjour à tous,

Je galère depuis pas mal de temps au sujet de mon fichier uploadé, il n'y a pas de message d'erreur mais le soucis c'est que dans la bdd, le path est renseigné sans slash dans la première partie, et j'ai beau cherché, je ne trouve pas

Voici mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
function nouveauFichier($option, $profile = '')
{
	global $my;
 
	if ($my) {
		$myPrivateRepository=new privateRepository();
		$myPrivateRepository->afficherPrivateRepositoryNouveauFichier($option, $profile);
	} else {
		mosRedirect( 'index.php', _NOT_AUTH );
	}
}
 
 
function ajoutFichier($option, $profile = '')
{
	global $my, $Itemid;
 
	//stop loading screen
	?>
	<script language="javascript" type="text/javascript">
	document.getElementById('sps_loading').style.display='none';
	</script>
	<?php
	$msg='';
	if ($my) {
//		if ($profile != '' && sps_Common::userIsAdmin()) {
//			$username = $profile;
//			$dest = '&task=administration&profile='.$profile;
//		} else {
//			$username=$my->username;
//		}
		if($_POST["file_owner"]!="")
		{
			$username=$_POST["file_owner"];
		}
		else 
		{
			$username=$my->username;
		}
 
 
			if (!sps_Common::ValidExtension($_FILES['uploadfichier']['name'])) {
				@unlink($_FILES['uploadfichier']['tmp_name']);
				$msg = _SPS_MSG_NOTALLOW_EXT;
				$dest = '&task=nouveau';
			} elseif (!$uploaddir = sps_Common::createDir($username)) {
				@delete_file($_FILES['uploadfichier']['tmp_name']);
				$msg = _SPS_MSG_CREATEFOLDER;
			} else {
				$filename=sps_Common::cleanFileName($_FILES['uploadfichier']['name'], 50);
				$uploadfile = $uploaddir . $filename;
				if(file_exists($uploadfile))
				{
					$update=true;
					if(!sps_Common::verifQuota($my->usertype,$_FILES['uploadfichier']["size"],$username,intval(filesize($uploadfile))))
					{
						$msg= _SPS_QUOTA_LIMIT;
					}
					else 
					{
						if (!move_uploaded_file($_FILES['uploadfichier']['tmp_name'], $uploadfile)) {
							$msg = _SPS_MSG_ERRORUPDATE;
						} else {
							$msg = _SPS_MSG_UPDATE_SUCCESS;
						}
					}
				}
				else 
				{
					if(!sps_Common::verifQuota($my->usertype,$_FILES['uploadfichier']["size"],$username))
					{
						$msg= _SPS_QUOTA_LIMIT;
					}
					else 
					{
							if (!move_uploaded_file($_FILES['uploadfichier']['tmp_name'], $uploadfile)) {
								$msg = _SPS_MSG_ERRORUPLOAD;
							} else {
								$msg = _SPS_MSG_UPLOAD_SUCCESS;
							}
						}
				}
			}
 
 
 
		if($msg==_SPS_MSG_UPLOAD_SUCCESS || $msg==_SPS_MSG_UPDATE_SUCCESS)
		{
			if($update)
			{
				if(sps_Common::userIsAdmin() && $_POST["file_owner"]!="")
				sps_File::update_file($filename,$uploaddir,sps_Common::getUsernameID($_POST["file_owner"]),$my->id,$_POST["sps_access_level"],time());
				else 
				sps_File::update_file($filename,$uploaddir,$my->id,$my->id,$_POST["sps_access_level"],time());
			}
			else 
			{
				if(sps_Common::userIsAdmin() && $_POST["file_owner"]!=""){
 
				sps_File::add_file($filename,$uploaddir,sps_Common::getUsernameID($_POST["file_owner"]),$my->id,$_POST["sps_access_level"],time());
				}else 
				sps_File::add_file($filename,$uploaddir,$my->id,$my->id,$_POST["sps_access_level"],time());
			}
		}
	}
 
	$dest='index.php?option=' . $option . '&Itemid=' . $Itemid . $dest;
	mosRedirect(sefRelToAbs($dest),$msg);
}

D'avance merci de votre aide,