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 7735277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:27:40+00:00 2026-06-01T07:27:40+00:00

I’m creating a video sharing website in django. Currently, if a user registers, and

  • 0

I’m creating a video sharing website in django.

Currently, if a user registers, and upload a video, it will be uploaded to media/vid/uploaded-vid. Then i converted using ffmpeg to flv. What i would like to do is this:

Someone with the username of alex1 registers, i would like to create a directory for him when he confirms his email, called /media/vid/members-vid/alex1

If he uploaded a video, it will be converted to flv in media/vid/uploaded-vid then copied to /media/vid/members-vid/alex1. And the video in media/vid/uploaded-vid should be deleted.

And I would like to secure /media/vid/. How do you secure django directories? Or is just an apache chmod?

i was wondering if i can use celery/rabbitqm to copy files from one folder to another, or to create new folders..

  • 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-06-01T07:27:42+00:00Added an answer on June 1, 2026 at 7:27 am

    Your use of a holding directory seems to be a good one. However having directories named after users is risky (what if someone provides a name which is an executable command name?) so using the user id might be better. Indeed if you are going to have lots of users you might want to consider splitting up user directories under some general directories to make finding the directories easier for admin purposes, and because some file systems have rather low limits on the number of entries under a directory — e.g. ext3 allows roughly 32K entries.

    For instance, a crude user directory scheme with outer directories named 1 to 9 for subdirectories starting with those numbers will give you a bit more flexibility here.

    So, assuming you have your uploaded files in /tmp/upload/1015/, and you want to move them to /var/userdata/01/1015/ and process files in /var/userdata/01/1015/, the following might be a sensible approach:

    • /tmp/upload/1015/ will need to be apache user or group writeable
    • record the need to process files in /tmp/upload/1015/ in a database, AMQP scheduling service such as RabbitMQ or an RPC/web services call
    • a scheduling service client running under its own userid picks up the job from db/AMQP/web call and does the following
      • run a virus check
      • runs a file sanity check to see if the source file is what it expects
      • copies the file to the user folder
      • if successful, removes the original file (or schedules a job to do that if it does not have permission to do so, or relies on a cronjob to delete files in /tmp/upload that are more than 24 hours old)
      • attempts to convert the files, updating relevant success/failure flags in the database as it goes along
      • deletes temporary files/unsuccessful source/output files on completion

    The list obviously would go on further for a while, depending on your needs. In the end you will have a user directory with files readable by apache but not writeable by the apache user. If your service grows you can move the video processing components of this service to another server.

    By the way there is a very good description of how to do this sort of thing (very simply) by Cal Henderson of Flickr in his O’Reilly book “Building Scalable Web Sites“. It was written in 2006 but his approach is refreshingly direct and straight-forward.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I am currently running into a problem where an element is coming back from
I need a function that will clean a strings' special characters. I do NOT
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.