How to limit the uploading file size in python?

Discussion in 'Python' started by praba kar, Jul 21, 2005.

  1. praba kar

    praba kar Guest

    Dear All,

    In Php we can limit the uploading file size
    by php.ini configuration file. But In python what
    way we can limit the file uploading size.
    kindly let me know.

    regards
    Prabahar



    __________________________________________________________
    How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
     
    praba kar, Jul 21, 2005
    #1
    1. Advertisements

  2. praba kar

    Fuzzyman Guest

    Hello Prabahar,

    It entirely depends on the mechanism you are using to receive the file
    (there is no generic solution).

    Is it within a CGI ? The normal way would be to check the file sized
    and discard if it's too big. You'll have to do it within your code -
    but it's probably a one line check !

    Best Regards,

    Fuzzy
    http://www.voidspace.org.uk/python
     
    Fuzzyman, Jul 21, 2005
    #2
    1. Advertisements

  3. praba kar

    Tim Roberts Guest

    Unlike PHP, Python is a general-purpose language that is not targetted
    specifically at the web, so it has no native concept of "uploading".

    You can do this by using the LimitRequestBody directive in your Apache
    configuration or .htaccess file.
     
    Tim Roberts, Jul 22, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.