source: branches/2.2/filemanager/inc/uploadApp.php @ 3894

Revision 3894, 1.5 KB checked in by alexandrecorreia, 13 years ago (diff)

Ticket #1660 - Enviar arquivos pelo filemanager, tratado o erro para o php.

Line 
1<?php
2
3session_id( $_GET['id'] );
4session_start();
5setcookie( 'jupload', $_GET['id'], time()+3600 );
6
7include 'jupload.php';
8
9function handle_uploaded_files($juploadPhpSupportClass, $files)
10{
11        return
12                "<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we "
13                . "just call the default behavior of the JUpload PHP class. Just replace this by your code...</P>"
14                . $juploadPhpSupportClass->defaultAfterUploadManagement();
15        ;
16
17}
18
19// Set Max File Size
20$maxFileSize = "10M";
21
22if ( file_exists('setFileMaxSize.php') )
23{
24        require_once('setFileMaxSize.php');
25        $maxFileSize  = unserialize(base64_decode($SET_FILE_MAX_SIZE));
26        $maxFileSize  = trim($maxFileSize)."M";
27}
28
29// Set Max Chunk Size
30$maxChunkSize = ini_get('upload_max_filesize');
31$maxChunkSize = ( $maxChunkSize*1024 )*1024;
32
33$appletParameters = array(
34                                                        'maxFileSize'           => $maxFileSize,
35                                                        'maxChunkSize'          => $maxChunkSize,
36                                                        'archive'                               => '../tp/juploader/wjhk.jupload.jar',
37                                                        'afterUploadURL'                => 'after_upload.php',
38                                                        'sendMD5Sum'            => 'true',
39                                                        'showLogWindow' => 'false',
40                                                        'debugLevel'                    => 0
41                                                );
42
43$classParameters = array(
44                                                        'demo_mode'     => false,
45                                                        'allow_subdirs' => true,
46                                                        'destdir'                       => '/tmp'  //Where to store the files on the webserver
47                                                );
48
49$juploadPhpSupportClass = new JUpload($appletParameters, $classParameters);
50
51echo '<div align="left"><!--JUPLOAD_FILES--></div>';
52echo '<div align="left"><!--JUPLOAD_APPLET--></div>';
53
54?>
Note: See TracBrowser for help on using the repository browser.