my web app upload files and save them to local storage (in a folder called “data” in root directory) successfully. But it doesn’t seem to work on Render live version. I get the following error. Any help would be appreciated. thanks
Jul 12 11:15:58 PM Traceback (most recent call last):
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
Jul 12 11:15:58 PM response = self.full_dispatch_request()
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
Jul 12 11:15:58 PM rv = self.handle_user_exception(e)
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
Jul 12 11:15:58 PM rv = self.dispatch_request()
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
Jul 12 11:15:58 PM return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jul 12 11:15:58 PM File "/opt/render/project/src/app.py", line 86, in index
Jul 12 11:15:58 PM file.save(file_path)
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/werkzeug/datastructures.py", line 3002, in save
Jul 12 11:15:58 PM dst = open(dst, "wb")
Jul 12 11:15:58 PM FileNotFoundError: [Errno 2] No such file or directory: 'uploads/emails.txt'
Jul 12 11:15:58 PM ERROR:app:Exception on / [POST]
Jul 12 11:15:58 PM Traceback (most recent call last):
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
Jul 12 11:15:58 PM response = self.full_dispatch_request()
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
Jul 12 11:15:58 PM rv = self.handle_user_exception(e)
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
Jul 12 11:15:58 PM rv = self.dispatch_request()
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
Jul 12 11:15:58 PM return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jul 12 11:15:58 PM File "/opt/render/project/src/app.py", line 86, in index
Jul 12 11:15:58 PM file.save(file_path)
Jul 12 11:15:58 PM File "/opt/render/project/src/.venv/lib/python3.10/site-packages/werkzeug/datastructures.py", line 3002, in save
Jul 12 11:15:58 PM dst = open(dst, "wb")
Jul 12 11:15:58 PM FileNotFoundError: [Errno 2] No such file or directory: 'uploads/emails.txt'```