Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4001492
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:54:42+00:00 2026-05-20T07:54:42+00:00

I am running Ubuntu with an Apache webserver with Mod_python. The root directory of

  • 0

I am running Ubuntu with an Apache webserver with Mod_python. The root directory of the web server is /var/www
I have a form for uploading files. The uploaded files should be stored in folder /var/www/xy/uploads by a python script.
But when I use this script, I receive an error:

Permission denied: '/var/www/xy/uploads/316.jpg'

Here the relevant parts of the code, that should handle the received files:

targetdir_path = "/var/www/xy/uploads"
newid = 316
f = open(os.path.join(targetdir_path,str(newid)+'.jpg'),"w")

I assume, there is a problem with the access rights of the uploads directory. They are set to: drwxr-xr-x

Can anyone explain me, what I need to change? Thanks for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:54:42+00:00Added an answer on May 20, 2026 at 7:54 am

    Your directory permissions are set for only allowing writing for the owner of the directory.
    try this:

    sudo chown www-data:www-data /var/www/xy/
    sudo chmod -R g+rw /var/wwww/xy/uploads
    

    Also, I’d advise against using mod_python as it is deprecated, look into mod_wsgi instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running Ubuntu8.041. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch configured Can't get file uploading
I have a PHP server at home for development. It is running: Ubuntu 9.10
PHP 4.4 and PHP 5.2.3 under Apache 2.2.4 on ubuntu. I am running Moodle
I have a laptop running Ubuntu that I would like to act as a
I have a Windows XP machine and a Linux machine running Ubuntu. I share
I have SBCL running on a Ubuntu machine. I want to write a little
So I've setup an Ubuntu server running the 8.04 release. I set it up
I've managed to get a C# asp page running under ubuntu/apache/mono, but I don't
I have just bought a VPS running Ubuntu and I need to install the
My work runs a couple different internal web apps on an ubuntu server (10.10)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.