This post is more than 5 years old
14 Posts
0
1098
Atmos-php uploads support file size > 2GB?
According to EsuHelpers.php and public function createObjectFromFile, there is a comment highlighted currently fails on file size > 2GB, is this still valid?
We are working on PHP version's API to support for file size upload >2GB, please share your experience is PHP able to support?
public function createObjectFromFile( $file, $acl = null, $metadata = null ) {
$fd = @fopen( $file, 'rb' );
if( $fd === false ) {
throw new EsuException( "Could not open file \"$file\"" );
}
$b = filesize( $file );
if( $b > 0 ) { // PHP currently fails >2GB
$this->totalBytes = $b;
}
return $this->createObjectFromStream( $fd, $acl, $metadata, true );
}
Thank you.
JasonCwik
281 Posts
1
March 13th, 2013 12:00
If you're running 64-bit PHP, you should be OK. However, this problem still exists in 32-bit PHP. See the warning in the PHP manual:
http://php.net/manual/en/function.filesize.php
HybridCloud
14 Posts
0
March 22nd, 2013 04:00
Thanks Jason for sharing this, am running Ubuntu 64-bit and should be fine, also tested and returned a 5.0E+19 result from the test code copied from reference PHP manual.
Thank you.