【问题标题】:Saving temporary file name after uploading file with uplodify使用 uplodify 上传文件后保存临时文件名
【发布时间】:2010-03-28 02:23:33
【问题描述】:

我有这个脚本

<?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,

我尝试了论坛的解决方案,但没有成功,有没有更简单的方法来解决这个问题?

【问题讨论】:

  • 您能否提供更多关于您如何实施uploadify 论坛链接中概述的解决方案的信息?

标签: php jquery ajax session uploadify


【解决方案1】:

抱歉,我又尝试了一次 $_POST['PHPSESSID'],现在正在工作,感谢您的帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-22
    • 2013-10-17
    • 2013-03-15
    • 2014-08-09
    • 2013-07-02
    • 1970-01-01
    • 2015-01-18
    • 1970-01-01
    相关资源
    最近更新 更多