调用功能两次但仅适用于第一次

I am executing this function which uploads a file to my Amazon S3 bucket for two separate files so I have the line of code in there twice but looking at two different files:

$s3->putObjectFile($file, "s3bucket", $directoryandfilename, S3::ACL_PUBLIC_READ);
$s3->putObjectFile($tbfile, "s3bucket", $tbdirectoryandfilename, S3::ACL_PUBLIC_READ);

But only the first line will ever run. Where am I going wrong?

The S3 PHP class documentation and code is at http://undesigned.org.za/2007/10/22/amazon-s3-php-class

I've never used any Amazon API, but after a quick look from their documentation, the putObjectFile() method is a legacy method, and may no longer be properly supported. Instead, you should consider using the inputFile() method.

See http://undesigned.org.za/2007/10/22/amazon-s3-php-class/documentation#inputFile