小编To.*_*. K的帖子

无法使用模式 r 打开:fopen():AWS Elastic Beanstalk

错误:无法使用模式 r 打开:fopen():文件名不能为空当我尝试上传更大的文件(超过 5MB)时,我不断收到此错误。我已将 PHP 应用程序上传到 AWS Elastic Beanstalk,并将文件上传到 AWS S3。我什至没有 fopen() 在代码中。

另外,当我使用 XAMPP 测试站点时,我没有收到此错误。

这是我用来将文件上传到 S3 的代码:

<?php

session_start();
require 'vendor/autoload.php';

  use Aws\S3\S3Client;
  use Aws\S3\Exception\S3Exception;

  // AWS Info
  $bucketName = 'tolga20.images';
  $IAM_KEY = '******************';
  $IAM_SECRET = '*************************';

  $feedback = '';
  $unqiue_num = mt_rand(1000, 9999);


  if(isset($_FILES['fileToUpload'])) {

    $user_set_id = $_POST['user_set_id'];



    // Connect to AWS
    try {
      // You may need to change the region. It will say in the URL when the bucket is open
      // and on …
Run Code Online (Sandbox Code Playgroud)

php amazon-web-services amazon-elastic-beanstalk

3
推荐指数
1
解决办法
3695
查看次数