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

  • SEARCH
  • Home
  • 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 3595916
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:54:55+00:00 2026-05-18T19:54:55+00:00

I have a check in place via php to determine if the file is

  • 0

I have a check in place via php to determine if the file is to big, the problem is, user has to upload the file to the server first, before i can make the check.

So if someone wanted to waste my bandwidth, all they woudl have to do is rename a huge file to .jpg for example and upload it. And there is nothing i can do to stop them

There must be some way to prevent this. Some kind of a valid check or jquery or something.

I need a solution that would allow me to notify the user that the file he is trying to upload is too big.

Thanks.

  • 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-18T19:54:56+00:00Added an answer on May 18, 2026 at 7:54 pm

    If you’re concerned about wasting bandwidth, then you must handle this at a higher level in your server stack. By the time PHP is handling the file it’s too late, the upload has already occurred and the bandwidth consumed.

    Apache has some configuration directives that may be useful:

    http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody

    But I’m not sure if even that actually cuts off the request when the body exceeds the limit. If not, you’d have to move up yet another level and handle it at the TCP level.

    If you do want to go down a non-PHP route to try to block large uploads, you should ask on ServerFault instead of StackOverflow.

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

Sidebar

Related Questions

I have a check in place via php to determine if the file is
Right now I have a check in place that analyzes the first word of
Where does the HTTPRequestObject place strings I have sent via POST to a php
I have a check box list in that user can check or uncheck the
So I have a page on facebook that has some tabs via apps that
(PHP 5.3.6) I have a php file which contains simply this text - there
I have a file that users will purchase via paypal, clickbank and paydotcom. I
I have a tab delimited text file that I need to upload to a
INSERT MODE i have check box in one tr. and another dropdown control in
In a table column I have check boxes which gives me indicator whether i

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.