Opened 17 years ago
Closed 17 years ago
#9625 closed defect (bug) (fixed)
Incorrect Upload Error Messages
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.8 | Priority: | normal |
| Severity: | normal | Version: | 2.8 |
| Component: | Upload | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
Noticed that the $upload_error_strings are invalid, this patch has the correct error_strings based on the actual php source code /main/rfc1867.c and php.net
See Also: http://www.php.net/manual/en/features.file-upload.errors.php
Attachments (1)
Change History (15)
#4
@
17 years ago
- Keywords has-patch tested added; needs-patch removed
Good one ryan, I attached an updated patch that removes the use defined constants.. here's the differences in the rfc1867.c files for 5.2.9 vs 4.3.0
PHP 4.3.0
#define UPLOAD_ERROR_OK 0 /* File upload succesful */ #define UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */ #define UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */ #define UPLOAD_ERROR_C 3 /* Partially uploaded */ #define UPLOAD_ERROR_D 4 /* No file uploaded */
PHP 5.2.9
#define UPLOAD_ERROR_OK 0 /* File upload succesful */ #define UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */ #define UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */ #define UPLOAD_ERROR_C 3 /* Partially uploaded */ #define UPLOAD_ERROR_D 4 /* No file uploaded */ #define UPLOAD_ERROR_E 6 /* Missing /tmp or similar directory */ #define UPLOAD_ERROR_F 7 /* Failed to write file to disk */ #define UPLOAD_ERROR_X 8 /* File upload stopped by extension */
#8
@
17 years ago
The empty string in the array is needed to keep the numbers in sync. Note that the error codes skip from 4 to 6.
Note: See
TracTickets for help on using
tickets.
Not all defines are available in PHP 4.3, which we still support. That's why we don't use them. Looks like we're only missing "File upload stopped by extension."