1 | <?php |
---|
2 | |
---|
3 | session_id( $_GET['id'] ); |
---|
4 | session_start(); |
---|
5 | setcookie( 'jupload', $_GET['id'], time()+3600 ); |
---|
6 | |
---|
7 | include 'jupload.php'; |
---|
8 | |
---|
9 | function 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 | |
---|
22 | if ( 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 | |
---|
51 | echo '<div align="left"><!--JUPLOAD_FILES--></div>'; |
---|
52 | echo '<div align="left"><!--JUPLOAD_APPLET--></div>'; |
---|
53 | |
---|
54 | ?> |
---|