Check out example codes for "Impossible to create the root directory "/var/www/html/laraship-subscription/storage/app/public/media/user_v1oz1Yz27j/26". It will help you in understanding the concepts better.

Code Example 1

My issues solved by just giving permission to the folder
chmod -R 777 /var/www/html/user_name/public/media

Learn ReactJs, React Native from akashmittal.com