-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathwhileuploading.php
26 lines (23 loc) · 1.3 KB
/
whileuploading.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require("inc/conn.php");
proteggi(1);
// PUBLIC SETTINGS
$tmpdir = _PATH_TMP; // your PHP temporary upload folder ( without last slash )
// for this method is better set this folder in a dedicated one
// to be sure that in that folder there isn't any other php temporary file
// APPLICATION - PLEASE DON'T MODIFY
require('./inc/UploadProgressManager.class.php'); // The class UploadProgressManager class
//session_start(); // need a session to be really efficient
clearstatcache(); // and maybe a cleared stats
$UPM = new UploadProgressManager($tmpdir); // new UploadProgressManager with temporary upload folder
if(($output = $UPM->getTemporaryFileSize()) === false) // if UPM class cannot find the temporary file
$output = '&filesize=undefined'; // the output for LoadVars will be undefined
else
$output = '&filesize='.$output; // else the output will be temporary file size
header('Content-Length: '.strlen($output)); // now headers to resolve browser cache problems
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
echo $output; // and finally the output for LoadVars