【发布时间】:2013-06-21 13:11:14
【问题描述】:
当我使用以下代码时:
$repertoire_destination = strtolower($_SESSION['login']);
//Déclaration de la classe
$up = new Telechargement($repertoire_destination,'form1','file','controle_form');
//Extensions autorisées (sans les .)
$extensions = array("gif","png","jpg","jpeg");
$up->Set_Extensions_accepte ($extensions);
$name_fichier = uniqid($_SESSION['login']);
// Rennommage des fichiers (en mode incrémentiel) si déjà présents sur le serveur.
$up->Set_Nomme_fichier($name_fichier,pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION));
$up->Set_Renomme_fichier($name_fichier);
$up->Set_Redim ('1920','1200');
$up->Set_Redim ('160','100','upload/'.strtolower($_SESSION['login']).'/thumb');
// Téléchargement
$up->Upload();
上传的文件必须保存在目录:strtolower($_SESSION['login']);
其中$_SESSION['login']) 包含用户名。
但不幸的是,它发送了一个空值。
以后用的时候:
$up->Set_Redim ('160','100','upload/'.strtolower($_SESSION['login']).'/thumb');
$_SESSION['login']) 包含 username。
谁能帮我解决这个问题?
【问题讨论】:
-
我懂法语,并且通过您为您的课程提供的链接,我担心许多其他人将无法阅读/理解该页面内的内容。我会看看我能做些什么来帮助你,但不能向你保证任何事情。尝试找到等效的英文链接。
-
是的,我知道...但不幸的是它不存在,我没有时间打开其他上传类。
-
现在,
session_start();是否存在/包含在您正在使用的所有.php文件中?如果使用会话,则必须包含它,并且它必须位于最顶部,在您的开始 PHP 标记<?php下方。这经常被忽视。 -
请提供英文的变量名和cmets
-
是的,你说得对......我没有考虑到这一点,因为第二次会话返回值。谢谢!