Skip to content

Commit

Permalink
Mime type not allowed message (#3722)
Browse files Browse the repository at this point in the history
* Mime type not allowed message

* Fix: css upload error label

---------

Co-authored-by: riccio82 <[email protected]>
  • Loading branch information
mauretto78 and riccio82 authored Jan 13, 2025
1 parent 06b82aa commit 2b1ba26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Utils/API/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ protected function _uploadFile( $fileUp ) {
if ( !$this->_isRightMime( $fileUp ) ) {
$this->setObjectErrorOrThrowException(
$fileUp,
new Exception ( __METHOD__ . " -> Mime type Not Allowed. '" . $out_filename . "'" )
new Exception ( __METHOD__ . " -> File format not supported. '" . $out_filename . "'" )
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/View/fileupload/upload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function validate( $uploaded_file, $file, $error, $index ) {

if ( $file->type !== null ) {
if ( !$this->_isRightMime( $file ) && ( !isset( $file->error ) || empty( $file->error ) ) ) {
$file->error = "Mime type Not Allowed";
$file->error = "File format not supported";

return false;
}
Expand Down
6 changes: 6 additions & 0 deletions public/css/sass/upload-page.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "commons/colors";

body {
margin: 0;
padding: 0;
Expand Down Expand Up @@ -1082,6 +1084,10 @@ tr.ready .size span {
visibility: visible;
}

.file_upload_error {
color: $redDefault;
}

.more {
margin-bottom: 5px;
float: left;
Expand Down

0 comments on commit 2b1ba26

Please sign in to comment.