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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:57:54+00:00 2026-05-31T14:57:54+00:00

I have that basic, well known multiple file upload form. Something like that… <input

  • 0

I have that basic, well known multiple file upload form. Something like that…

<input type="file" multiple="multiple" name="something[]" />

Is there a way (preferable a hard coded option) to limit the number of files that user can select? By limit i mean strictly blocked, not just a warning if number is exceeded.

Thanks in advance. 🙂

  • 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-31T14:57:56+00:00Added an answer on May 31, 2026 at 2:57 pm

    You can implement a javascript solution to check the number of files that have been selected, which you can then use to forbid uploading to the server. There are really only going to be client-side solutions to this problem though, as there is really nothing stopping a user from posting these files to your php script anyway. You can specify a maximum upload size limit, but it isn’t specific to the number of files that are being uploaded.

    Your best bet is to implement some javascript checking, specifying a reasonable maximum upload size for your http server (or in PHP), and then ignoring any file uploaded if it exceeds your maximum count.

    Read about the HTML5 File API here to restrict the count of selected files: http://dev.w3.org/2006/webapi/FileAPI/

    Here is the php.ini docs which explain how to make a size limitation on uploads: http://php.net/manual/en/ini.core.php

    As was suggested in the comments, check out: http://php.net/manual/en/ini.core.php#ini.max-file-uploads

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

Sidebar

Related Questions

I have a basic form consisting of input fields as well as a file
I have a website that uses basic ASP.Net forms authentication. In the web.config file
I have a multipart form that takes basic user information at the beginning with
I have a basic form that I'm using for member registration. I'm using the
i have an editor that is basic microsoft actions: createlink bold etc. i made
I have a PHP script that does basic encryption of a string through the
I have a parameterized hibernate dao that performs basic crud operations, and when parameterized
Recently I have purchased a notebook that came with Windows Home Basic (that don't
I have a basic class that derived subclasses inherit from, it carries the basic
I have a basic doubt that, How can we have both CLR's on a

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.