• Hey, I was wondering if it’s possible to modify WordPress to only accept certain file types, or set a max amount of space used for file uploads (or set file size restrictions). I want to prevent large audio or video files from being uploaded into WordPress.

    P.S. I don’t know whether this should be in How-To or Hacks.
    P.P.S. I know PHP and SQL, so I don’t necessarily need a click solution, just to be pointed in the right direction.

    Many thanks, Enaqbz.

Viewing 1 replies (of 1 total)
  • When your receiving script gets the upload stream, the message has some http headers, among which one should be content-length. As the whole process of exchanging data follows the CGI protocol, the header information should be available to the script ( PHP engine ).

    So it should be possible to read the content-length environment variable and refuse too long files with a polite message back to the uploader.

    I know this is harsh language to many users, but if you know PHP, you may be able to solve the problem.
    ( If I knew PHP, I could give a more detailed solution )

Viewing 1 replies (of 1 total)
  • The topic ‘Placing Upload Restrictions’ is closed to new replies.