So I have a Django app hosted on Heroku that has an endpoint which accepts image uploads. The images are saved to my AWS bucket, which is charged to me. Right now, I am able to upload images by making a multipart request with the Postman app.
My goal is to allow my android app to accept image uploads from the user. However, my understanding of web applications is very limited, and I don't understand how to prevent people from just uploading arbitrarily large files to my endpoint and racking up a big charge to my AWS/Heroku accounts. After all, it's just a URL I send POST requests to. So,
What is a good way of preventing people from uploading indiscriminately to my server so I dont wake up with a $10k bill from Amazon?
- My blind guess is that there is some practice of sending authentication from the client - Is there a good way of doing this without making users go through a log in service?
If I mess up, will hosting services, (like Heroku or Amazon) provide some safety net to prevent racking up massive charges?
What do big services like imgur do to prevent people from uploading huge amounts of data?