I'm new to AWS S3 and trying to upload a zipped folder. I have a directory structure like this:
- /home/8xjf/2022 (this is the parent folder I'm struggling with)
- /home/8xjf/2022/uploads (I can zip and upload this folder successfully)
- /home/8xjf/aws (where my script resides)
My script works for the 'uploads' folder, but it fails when I attempt it on the '2022' folder, which contains multiple sub-folders as well. I've maxed out 'upload_max_filesize' and 'post_max_size' but I keep encountering errors. Below is the PHP code I'm using to create the zip and upload it. Can anyone help me figure out how to make it work for the '2022' folder instead? Any insights would be appreciated!
1 Answer
It looks like the issue isn't really with AWS but rather with your local setup. Have you tried creating the directory `/home/8xjf/aws` first? It seems like your script is trying to open a zip file in that directory but can't find it. Also, just a heads-up—reimplementing functionality like `zip -r` in PHP might not be the best approach since you're overloading your memory. You might want to look into using the command line tool directly for zipping.
Thanks for the tip! I thought the directory existed since all my scripts are there. I’ll try creating it as you suggested. Also, I get what you mean about the zipping. Should I remove some of my code to make it better?