0

I have created a flask application and tried to deploy on apache2 Ubuntu server using WSGI. but I am getting Permission denied: 'video.mp4' error. In flask application default route returns a string but I am getting the following error when the flask application tries to download a file from azure blob storage to the current directory init.py.

File "/var/www/FlaskApp/FlaskApp/__init__.py", line 25, in watermark 
block_blob_service.get_blob_to_path(container, blob, 'video.mp4')
File "/usr/local/lib/python2.7/dist-packages/azure/storage/blob/baseblobservice.py", line 1801, in get_blob_to_path
with open(file_path, open_mode) as stream:
IOError: [Errno 13] Permission denied: 'video.mp4'

also tried to activate virtual env in WSGI and even changed the permissions but nothing is working. Any help would be appreciated.

Dhvani Shah
  • 351
  • 1
  • 7
  • 17
  • Don't use a relative path for the file. The documentation explains this in http://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html#application-working-directory – Graham Dumpleton Mar 17 '18 at 11:38

1 Answers1

0

I resolved this in the end by chmod'ing the folder listed in the "Permission denied" section to 777. After going through a sudo chmod /home/yourdownload/folder/ 777 . So not the file but the folder where you upload/download to.