PHP会话没有';不能传递文件

PHP会话没有';不能传递文件,php,session,uploadify,Php,Session,Uploadify,我正在为我的脚本使用Uploadify 主页: <?php session_start(); var_dump($_SESSION); $uploaded_files = $_SESSION['uploaded_files']; ?> //Uploadify, HTML forms and more (not related, No PHP in this section) //Uploadify、HTML表单等(不相关,本节中没有PHP) uploadify.php:

我正在为我的脚本使用Uploadify

主页:

<?php

session_start();

var_dump($_SESSION);
$uploaded_files = $_SESSION['uploaded_files'];

?>

//Uploadify, HTML forms and more (not related, No PHP in this section)

//Uploadify、HTML表单等(不相关,本节中没有PHP)
uploadify.php:

<?php

session_start();

require_once('includes/functions.php');

// Define a destination
$targetFolder = 'uploads/temp'; // Relative to the root

if (!empty($_FILES)) {
    $fileParts = pathinfo($_FILES['Filedata']['name']);
    $file_hash = GenRndStr(20) . '.' . $fileParts['extension'];
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $targetPath = $targetFolder;
    $targetFile = rtrim($targetPath,'/') . '/' . $file_hash;

    // Validate the file type
    $fileTypes = array(); // File extensions

    move_uploaded_file($tempFile, $targetFile);
    $_SESSION['uploaded_files'][] = $file_hash;
    echo '1';
}

?>

我确信它会进入
$\u会话['uploaded\u files'][]=$file\u hash部分,因为实际文件已上载到目录。我的问题是
$\u会话['upload\u files']
var\u dump
返回空值

这些文件位于同一目录级别


提前谢谢。

我找到了解决办法。问题是Uploadify的flash版本被视为服务器的不同客户端,因此服务器会为其创建一个新的会话id

我关注这个话题:
希望它能帮助其他人。

上层
var_dump的输出是什么?在最后一个
}
之后的第二个文件中,
$SESSION
变量转储是什么?实际的过程是什么?您通过uploadify.php上传文件,将散列存储在会话中,并且无法在(比如)main.php中访问这些文件,之后会显示这些文件吗?另外,
echo session_id()的输出
会话_start()之后
可能会提示您是否每次都在访问同一个会话。第一次转储为null,第二次为正确的列表。我现在看到页面生成不同会话的id。这怎么可能?谢谢你指出这一点,我已经坐了几个小时试图解决它。