source: extensions/upload_form/uploadify/uploadify.php @ 4875

Last change on this file since 4875 was 4875, checked in by plg, 14 years ago

feature 1141 added: multiple select and progress bar with uploadify (jQuery
plugin).

Note: the HTML upload is disabled but I will provide a switch, either you use
Uploadify OR you use HTML multiple file boxes.

File size: 1.0 KB
Line 
1<?php
2define('PHPWG_ROOT_PATH','../../../');
3define('IN_ADMIN', true);
4
5$_COOKIE['pwg_id'] = $_POST['session_id'];
6
7include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
8include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
9include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php');
10
11define('UPLOAD_FORM_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/../');
12include_once(UPLOAD_FORM_PATH.'include/functions_upload.inc.php');
13
14check_pwg_token();
15
16ob_start();
17print_r($_FILES);
18print_r($_POST);
19print_r($user);
20$tmp = ob_get_contents(); 
21ob_end_clean();
22error_log($tmp, 3, "/tmp/php-".date('YmdHis').'-'.sprintf('%020u', rand()).".log");
23
24$image_id = add_uploaded_file(
25  $_FILES['Filedata']['tmp_name'],
26  $_FILES['Filedata']['name'],
27  null,
28  8
29  );
30
31if (!isset($_SESSION['uploads']))
32{
33  $_SESSION['uploads'] = array();
34}
35
36if (!isset($_SESSION['uploads'][ $_POST['upload_id'] ]))
37{
38  $_SESSION['uploads'][ $_POST['upload_id'] ] = array();
39}
40
41array_push(
42  $_SESSION['uploads'][ $_POST['upload_id'] ],
43  $image_id
44  );
45
46echo "1";
47?>
Note: See TracBrowser for help on using the repository browser.