How to upload files to ec2 instance through flask
You will not be able to upload directly to the /dev/xvda/upload/hello.txt path, as this is a block device, not a mounted file system (raw hard drive).
You will need to use the path like /upload.
It is likely you are running into permission issues with the /upload folder. As a test I would suggest using the /tmp/ folder for your uploads, that should have open file permissions. If that works then you know it was permission issues preventing /upload from working. To make the /upload folder work, you will need to chown it to the same user that your flask app is running as. (There are other ways to make it work, but this is probably the easiest).
chown flask_user /upload
I have a web app that has to upload a file from local system to flask app on ec2 instance. I defined the upload path and when I access it I get an IOError saying:
 IOError: [Errno 20] Not a directory: '/dev/xvda/upload/hello.txt'
I've also tried to use only: /upload
Both of them do not work, I have created the folder on the instance using mkdr command