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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:23:16+00:00 2026-05-20T02:23:16+00:00

I have a form to upload 2 files. They can upload one, or just

  • 0

I have a form to upload 2 files. They can upload one, or just upload both at the same time.
When I upload 2 small image files (both under 100kb), they work perfect. But if one file is larger, say around 200kb, it doesn’t work. I already set the max value to “100000” in the hidden tag below, so I’m not sure what else I can do to fix this?

<form enctype="multipart/form-data" action="upload.php" method="post">    
<b>Image File</b><br />
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />

<b>Large Image</b>: <input type="file" name="uploadedfile1" size="30" /><br />

<b>Thumb Image</b>: <input type="file" name="uploadedfile2" size="30" /><br />

<center><input type="submit" name="submit" value="submit" class="button"></center>

</form>

When it’s processed, it goes to this php code:

$uploadedfileBase1 = basename($_FILES['uploadedfile1']['name']);
$uploadedfileTemp1 = $_FILES['uploadedfile1']['tmp_name']; 
$uploadedfileBase2 = basename($_FILES['uploadedfile2']['name']);
$uploadedfileTemp2 = $_FILES['uploadedfile2']['tmp_name']; 


// Large Image
$target_path_large = $target_path . "large/" . $uploadedfileBase1; 

if(move_uploaded_file($uploadedfileTemp1, $target_path_large)) {
echo "<p>The <b>large</b> file \"$uploadedfileBase1\" has been uploaded.</p>";
} else{
echo "<p>There was an error uploading the <b>large</b> file <i>$uploadedfileBase1</i>, please try again!</p>";
}

// Thumb Image
$target_path_thumb = $target_path . "thumbs/" . $uploadedfileBase2; 

if(move_uploaded_file($uploadedfileTemp2, $target_path_thumb)) {
echo "<p>The <b>thumbnail</b> file \"$uploadedfileBase2\" has been uploaded.</p>";
} else{
echo "<p>There was an error uploading the <b>thumbnail</b> file <i>$uploadedfileBase2</i>, please try again!</p>";
}

Thank you for reading!

  • 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-20T02:23:17+00:00Added an answer on May 20, 2026 at 2:23 am

    You should check the file php.ini at your server, specially the following parameters:

    1. post_max_size

    2. upload_max_filesize

    3. max_execution_time

    4. max_input_time

    5. memory_limit

    In your case, the problem maybe about too small post_max_size & upload_max_filesize.

    EDIT: Now I notice it, you yourself define MAX_FILE_SIZE = 100000 bytes < 100 KB in the hidden field. So your upload file can not exceed 100kB for sure. If you want to upload larger file, you must increase that value.

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

Sidebar

Related Questions

I have a form which includes 3 textfields so users can upload files. They
If I have form where user can upload files via Ajax (and upload is
I have a form in my django app where users can upload files. How
I have a form from which users can select 100s of files to upload
I have a form where users can upload an image. I have another page
I currently have this script where users (using a form where they can upload
i have the form, and i want to upload two files. here is the
I have a form where the user can upload a zip file, it works
I have form with file upload. The files to be uploaded actually are pictures
I have a upload field where people can upload a image. I'd like to

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.