Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iAppsMail - File Upload
#4
my idea is to call frequently the filesize php script.
you need to know the temp name and path of the upload file on the server.


Code:
Copy      Help
str filename="tempfile.zip"
str return post.format("filename=%s" filename)

IntPost "http://localhost/filesize.php" post return
out return


filesize.php
Code:
Copy      Help
<?php
$file=$_POST['filename'];

function size_hum_read($size){
/*
Returns a human readable size
*/
  $i=0;
  $iec = array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
  while (($size/1024)>1) {
   $size=$size/1024;
   $i++;
  }
  return substr($size,0,strpos($size,'.')+4).$iec[$i];
}
echo size_hum_read(filesize($file));

?>
pi


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)