aelnaiem
aelnaiem

Reputation: 103

Upload Destination

I've been building a small blog with the python micro-framework flask and I want to be able to upload photos for blogposts. I found the flask-uploads package, which makes it very convenient to incorporate upload to an application. I then found the source on bitbucket along with an example.

The example puts uploaded photos into /tmp/photolog, but I wanted a more permanent location for my uploads, so I chose to use a folder within my application folder, but that caused an OSERROR 13 (permission error). Further reading suggested that I might need to update the permissions for the folder I want to use for uploads, but I'm not sure exactly how I should configure the permissions to make this work.

I read a little bit about flask 0.8's instance folder which should be used for uploads, but simply trying to upload to a folder named instance within my application directory doesn't seem to make a difference (which is to be expected).

This seems to be a very simple problem and I've found flask to be a very easy-to-use framework, but I can't seem to find a solution anywhere. I'm sure I'm completely misunderstanding how the instance folder is supposed to be used, but I'm struggling to find examples.

Upvotes: 2

Views: 510

Answers (1)

Giel
Giel

Reputation: 2875

You just have to make sure that the user or group that your server runs as has write access to the directory where you want to upload those files.

Upvotes: 4

Related Questions