46 Posts
Castor
10 years ago
1
Topic
Hi Seblod-Team,
hi all,

If an error occurs while uploading images or files

- Illegal Extension or
- Maximum File Size exceeded

all following images or files are deleted from the array whether newly added or already existing.

For example:

image 1
image 2
image 3 (error) newly added but to big
image 4
image 5
image 6
image 7

Processing:


image 1
image 2
image 3 (error) newly added but to big
image 4
image 5
image 6
image 7


result after store:

image 1
image 2


Image 3 generates an error and is not saved (thats right) but also all the other images (image 4 until image 7) will not be considered.

The semaphore $field->error is set always to true during processing for all images after an error has occured. In the files upload_image.php and upload_file.php you have to add $field->error = false; before return:

upload_image.php:
531: if ( isset( $field->error ) && $field->error === true ) {
532: $field->error = false;
533: return;
534: }

upload_file.php:
529: if ( isset( $field->error ) && $field->error === true ) {
530: $field->error = false;
531: return;
532: }

I have create an entry on the tracker.

Best regards
Castor
Get a Book for SEBLOD
4229 Posts
Kadministrator
10 years ago
0
Level 1
Hi Castor,

thank you for your report and solution.
Get a Book for SEBLOD