Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #454
    dan
    Participant

    Got an error uploading a file using Spatie Media Library

    $question ->addMedia(‘path’, ‘s3’) ->toMediaCollection();

    #458

    Few things you need to check

    (1) Make sure that in ENV file the FILESYSTEM_DISK is set to s3
    (2) Make sure you filled up the AWS credentials in the ENV file

    AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY
    AWS_DEFAULT_REGION
    AWS_BUCKET
    AWS_USE_PATH_STYLE_ENDPOINT

    (3) Also change your code to this
    $question ->addMedia(‘path’) ->toMediaCollection(‘collectionname’, ‘s3’);

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.