使用uploadify上传文件后保存临时文件名

时间:2010-03-26 19:33:40

标签: php jquery ajax session uploadify

我有这个脚本

<?php

if (!empty($_FILES)) {
  $tempFile = $_FILES['Filedata']['tmp_name'];
  $targetPath = dirname(__FILE__) . $_POST['folder'] . '/';
  $pathinfoFile = pathinfo($_FILES['Filedata']['name']);
  $targetFile =  str_replace('//', '/', $targetPath) . uniqid() . '.' . $pathinfoFile['extension'];
  move_uploaded_file($tempFile, $targetFile); 
}

此脚本来自Uploadify,已修改以保存具有唯一名称的文件。我需要在用户上传文件后保存临时,唯一和原始名称。当用户最终提交表单时,将使用这些值。我试图在$_SESSION中保存这些值,但我遇到了这里列出的问题:

http://uploadify.com/forum/viewtopic.php?f=5&t=43

我在论坛上尝试了解决方案,但它没有用,是否有更简单的方法来解决这个问题?

1 个答案:

答案 0 :(得分:0)

抱歉,我再次尝试使用$_POST['PHPSESSID'],现在正在使用,感谢您的帮助

相关问题