source: trunk/admin/include/uploadify/uploadify.php @ 5089

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

feature 1489: integrate UploadForm into Piwigo core. The integration is not
100% done, I just "made it work" on trunk.

pclzip library was updated to version 2.8.2 for memory usage improvement.

File size: 916 bytes
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_upload.inc.php');
10
11// check_pwg_token();
12
13ob_start();
14print_r($_FILES);
15print_r($_POST);
16print_r($user);
17$tmp = ob_get_contents(); 
18ob_end_clean();
19error_log($tmp, 3, "/tmp/php-".date('YmdHis').'-'.sprintf('%020u', rand()).".log");
20
21$image_id = add_uploaded_file(
22  $_FILES['Filedata']['tmp_name'],
23  $_FILES['Filedata']['name'],
24  null,
25  8
26  );
27
28if (!isset($_SESSION['uploads']))
29{
30  $_SESSION['uploads'] = array();
31}
32
33if (!isset($_SESSION['uploads'][ $_POST['upload_id'] ]))
34{
35  $_SESSION['uploads'][ $_POST['upload_id'] ] = array();
36}
37
38array_push(
39  $_SESSION['uploads'][ $_POST['upload_id'] ],
40  $image_id
41  );
42
43echo "1";
44?>
Note: See TracBrowser for help on using the repository browser.