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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:14:38+00:00 2026-05-14T07:14:38+00:00

I am writing a custom error handling / reporting function for PHP file upload

  • 0

I am writing a custom error handling / reporting function for PHP file upload and I noticed that the error codes returned are numbered from 0 to 8 except 5.

Is this a typo in the source I am using or is it really this way? If it is so, I am curious why they have skipped number ‘5’.

Thanks.

Edit
In response to Pekka, here are the error codes from PHP manual.

0 | UPLOAD_ERR_OK         | There is no error, the file uploaded with success.
1 | UPLOAD_ERR_INI_SIZE   | Size exceeds upload_max_filesize in php.ini.
2 | UPLOAD_ERR_FORM_SIZE  | Size exceeds MAX_FILE_SIZE specified in HTML form.
3 | UPLOAD_ERR_PARTIAL    | The uploaded file was only partially uploaded.
4 | UPLOAD_ERR_NO_FILE    | No file was uploaded.
5 | UPLOAD_ERROR_E        | As explained by @Progman, removed in rev.  81792
6 | UPLOAD_ERR_NO_TMP_DIR | Missing a temporary folder.
7 | UPLOAD_ERR_CANT_WRITE | Failed to write file to disk.
8 | UPLOAD_ERR_EXTENSION  | File upload stopped by extension.
  • 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-14T07:14:38+00:00Added an answer on May 14, 2026 at 7:14 am

    It doesn’t matter as you use the UPLOAD_ERR_* constants anyway. But I guess the field 5 was an error which is now handled by a different error case.

    Edit

    The case “5” was an error for empty uploaded files. However this isn’t an error so the field/constant got removed. See changeset 81792 on main/rfc1867.c and changeset 88408 on main/rfc1867.c

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

Sidebar

Related Questions

I'm writing a WCF service with some authentication and a custom error handler. However,
I'm writing a custom ContentProvider that serves up content consisting of a single, constant
I am writing a small console application in C# that references a custom assembly
I'm in the situation where I'm writing custom error pages for a webapp (primarily
I'm writing a custom validator that is going to check for the existence of
I am writing a custom report from an Avamar (Postgresql) database which contains backup
I'm writing a custom view that directly extends android.view.View . If I try to
I'm writing a custom web part that is intended to be hosted in SharePoint.
I'm writing a custom view to get around the bug that displays the wrong
I'm currently writing a custom component in Java that instead of writing a static

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.