Hello guys I wrote an app with Flask/python and deployed on Heroku. Than I realised Heroku destroys files written within its filesystem. So I thought I could maybe use dropbox for uploading and deleting users avatar images.
I need to to something like the following:
Delete avatar of user:
image = 'static/uploads/' + str(userToDelete) + '.jpg'
os.remove(image)
Create avatar for user where name is user ID:
filename = str(userName.id)
file.save(os.path.join(
app.config['UPLOAD_FOLDER'],
filename + ".jpg")
The ideal thing would be to create a dropbox public folder, get its URL and store there one image per user being the image name the users id .jpg
Like:
https://www.dropbox.com/myaccount/avatars/1.jpg
https://www.dropbox.com/myaccount/avatars/2.jpg
ETC...
This way i don't need a table to store url for each user avatar.
Is this possible with dropbox
I am completely new to dropbox API, help and suggestions are very much apreciated