uploadify.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. exit;
  3. require_once(dirname(__FILE__).'/../../inc/config.inc.php');
  4. /*
  5. **************************
  6. (C)2010-2013 phpMyWind.com
  7. update: 2012-9-15 10:50:00
  8. person: Feng
  9. **************************
  10. */
  11. //初始化参数
  12. $action = isset($action) ? $action : '';
  13. $iswatermark = isset($iswatermark) ? $iswatermark : '';
  14. $timestamp = isset($timestamp) ? $timestamp : '';
  15. $verifyToken = md5('unique_salt'.$timestamp);
  16. //判断上传状态
  17. if(!empty($_FILES) && $token==$verifyToken && isset($sessionid))
  18. {
  19. //引入上传类
  20. require_once(PHPMYWIND_DATA.'/httpfile/upload.class.php');
  21. $upload_info = UploadFile('Filedata', $iswatermark);
  22. /* 返回上传状态,是数组则表示上传成功
  23. 非数组则是直接返回发生的问题 */
  24. if(!is_array($upload_info))
  25. echo '0,'.$upload_info;
  26. else
  27. echo implode(',', $upload_info);
  28. exit();
  29. }
  30. //删除元素
  31. if($action == 'del')
  32. {
  33. $dosql->ExecNoneQuery("DELETE FROM `#@__uploads` WHERE path='$filename'");
  34. unlink(PHPMYWIND_ROOT .'/'. $filename);
  35. exit();
  36. }
  37. ?>