Support Forums - Classified Ads Script Osclass

General osclass questions => General discussion => Topic started by: iiui awan on April 16, 2022, 03:32:13 AM

Title: facing error while uploing image
Post by: iiui awan on April 16, 2022, 03:32:13 AM
facing error while uploing image


062715bdef49d916a21...955b.jpg_.webp has an invalid extension. Valid extension(s): png, gif, jpg, jpeg.
Title: Re: facing error while uploing image
Post by: MB Themes on April 16, 2022, 11:49:13 AM
Osclass does not support webp images to be uploaded.
Title: Re: facing error while uploing image
Post by: iiui awan on April 17, 2022, 08:41:24 PM
will you please add option to upload that file
Title: Re: facing error while uploing image
Post by: MB Themes on April 19, 2022, 04:50:32 PM
No plans for that right now. It is not expected casual user will have webp images.
Anyway you should be able to update hardcoded list of extensions somewhere in t_preference table.
Title: Re: facing error while uploing image
Post by: mwindey on April 20, 2022, 12:20:13 PM
This was easy to do....

First download backup of your database file and copy/paste for safe editing.

Search for:
Code: [Select]
('osclass','allowedExt','png,gif,jpg,jpeg','STRING'), and replace with:
Code: [Select]
('osclass','allowedExt','png,gif,jpg,jpeg,webp','STRING'),
Then clear database and upload edited file (make sure you uncheck Enable Foreign Key Field Checking)

 :P More easy is open PhpMyAdmin - go to t_preference and edit table
osclass /allowedExt/ png,gif,jpg,jpeg with png,gif,jpg,jpeg,webp

In oc-includes/osclass look for file mimes.php and search for line:
Code: [Select]
  'gif' => 'image/gif',
underneath that line add:   
Code: [Select]
'webp' => 'image/webp',
Save file/Upload to server and your done.
Title: Re: facing error while uploing image
Post by: MB Themes on April 20, 2022, 03:29:37 PM
@mwindey
Thanks for help, forgot about mime ;)
Title: Re: facing error while uploing image
Post by: mwindey on April 21, 2022, 02:41:03 PM
@MB Themes,
I suspected it and that's why I made it clearer...Anyway it was your comment that made me think about it  :) :)