How to unlock the file after AWS S3 Helper uploading file?

前端 未结 4 411
猫巷女王i
猫巷女王i 2021-01-04 06:36

I am using the official PHP SDK with the official service provider for laravel to upload an image to Amazon S3. The image is temporarily stored on my server and should be de

4条回答
  •  礼貌的吻别
    2021-01-04 06:53

    EDIT: I just noticed the string in your $temp_path begins with a "/" slash character. This beginning slash typically starts at the root directory of the website, are you sure this is the correct location? Use the getcwd() command in PHP to find out what folder PHP thinks it is inside of.

    I understand you believe the permissions are correct but in light of the "Permission denied" error I still believe it is telling you something relevant.

    I see you are trying to chown the directory, did you perhaps mean to chmod it? If you can SSH to your server and run this command you may have more luck:

    chmod -R 777 /(your-website-dir/screenshot_temp
    

    Or even try changing the "chown" to "chmod" in your PHP code.

提交回复
热议问题