return;
}
- void resizeImage(element, file).then((resizedFile) => {
- void upload(element, resizedFile);
- });
+ void resizeImage(element, file)
+ .then((resizedFile) => {
+ void upload(element, resizedFile);
+ })
+ .catch(() => {
+ innerError(element, getPhrase("wcf.upload.error.damagedImageFile", { filename: file.name }));
+ });
});
element.addEventListener("ckeditorDrop", (event: CustomEvent<CkeditorDropEvent>) => {
else if (!validateFileSize(element, file)) {
return;
}
- void resizeImage(element, file).then((resizedFile) => {
+ void resizeImage(element, file)
+ .then((resizedFile) => {
void upload(element, resizedFile);
+ })
+ .catch(() => {
+ (0, Util_1.innerError)(element, (0, Language_1.getPhrase)("wcf.upload.error.damagedImageFile", { filename: file.name }));
});
});
element.addEventListener("ckeditorDrop", (event) => {
$event->preload('wcf.style.changeStyle');
+ $event->preload('wcf.upload.error.damagedImageFile');
$event->preload('wcf.upload.error.fileExtensionNotPermitted');
$event->preload('wcf.upload.error.fileSizeTooLarge');
$event->preload('wcf.upload.error.maximumCountReached');
<item name="wcf.upload.error.reachedRemainingLimit"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} zu viele Dateien ausgewählt. {if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} nur noch {#$maxFiles} weitere Datei{if $maxFiles != 1}en{/if} hochladen.]]></item>
<item name="wcf.upload.error.uploadFailed"><![CDATA[Beim Hochladen der Datei ist ein unbekannter Fehler aufgetreten.]]></item>
+ <item name="wcf.upload.error.damagedImageFile"><![CDATA[Die Grafikdatei „{$filename}“ ist beschädigt.]]></item>
<item name="wcf.upload.error.fileExtensionNotPermitted"><![CDATA[Der Dateityp von „{$filename}“ ist unzulässig.]]></item>
<item name="wcf.upload.error.fileSizeTooLarge"><![CDATA[Die Datei ist zu groß.]]></item>
<item name="wcf.upload.error.maximumCountReached"><![CDATA[Es {plural value=$maximumCount 1='darf nur eine Datei' other='dürfen nur # Dateien'} hochgeladen werden.]]></item>
<item name="wcf.upload.error.reachedRemainingLimit"><![CDATA[You have selected too many files. You can only upload {#$maxFiles} more file{if $maxFiles != 1}s{/if}.]]></item>
<item name="wcf.upload.error.uploadFailed"><![CDATA[An unknown error occurred during the upload.]]></item>
+ <item name="wcf.upload.error.damagedImageFile"><![CDATA[The graphics file “{$filename}” is damaged.]]></item>
<item name="wcf.upload.error.fileExtensionNotPermitted"><![CDATA[The file type of “{$filename}” is not permitted.]]></item>
<item name="wcf.upload.error.fileSizeTooLarge"><![CDATA[The file is too large.]]></item>
<item name="wcf.upload.error.maximumCountReached"><![CDATA[{plural value=$maximumCount 1='Only one file' other='Only up to # files'} may be uploaded.]]></item>