0

I'm trying to get flask upload images to a folder but when I try and save it i get an error 13 Permission denied. This is the code that im using:

    if request.method == "POST":

        file = request.files['file']

        picture_path = os.path.join(current_app.root_path, 
        'static/profile_pics', file.filename)

        i = Image.open(file)
        i.save(picture_path)

I'm pretty sure its an issue with permissions on the apache server but I'm not sure how I would fix that.

1 Answer 1

2

Change mode

sudo chmod -R 777 static/profile_pics

or change owner

sudo chown -R username:group static/profile_pics

hope may help you ;)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.