"Supported file types are JPG, PNG and GIF" when uploading jpg, png or gif #28
Comments
Do you have webm uploading enabled in the settings? Here's two bits of code you can use to debug. https://github.com/tslocum/TinyIB/blob/master/settings.default.php#L35 Line 49 in b2c0b69
Under the post form there should be a list of allowed file types. Is webm one of them? |
Hi again and thanks for the reply! I'm not an expert in php as you can see hehe. But yeah, I've checked the settings.php lots of times and everything is written like the code you sent me. I've been making sure the WebM option is not enabled (in fact I don't want to upload WebM). Just jpg, png and gif. I've investigating but at the moment I didn't find a solution :( |
After this line: Line 162 in b2c0b69
Add: |
Sorry for the late reply. Warning: shell_exec() has been disabled for security reasons in /usr/home/dlastframe.com/web/boards/imgboard.php on line 163 What does it mean? Thanks |
Your installation of PHP is disabling the shell_exec function. Under some circumstances, it can lead to a remote code execution vulnerability, especially if unfiltered user input is passed into it. Try this: |
Hi Wquer555, this is what I get: image/jpeg |
That looks correct. Try replacing |
It says again "Supported file types are JPG, PNG and GIF". Is it normal? |
That's odd.
Do
Alternatively you can try replacing |
With the first option: And the second one: |
I've been investigating and maybe the problem "shell_exec() has been disabled for security reasons" could be with Safe Mode wich surely is in mode on. I´m witing back when i get a response. Thanks a lot guys for your fast replies. |
$file_mime may be getting changed. Try putting |
Again: "Supported file types are JPG, PNG and GIF" |
The problem is that the expression |
I wrote this, I don't know if is what u said:
And I get "Supported file types are JPG, PNG and GIF" |
fancyDie will print the error message and terminate the script, so you will never run the code following. Try this:
|
Here it is what I got $file_mime is empty |
If |
To fix it's:
|
Why is shell_exec used when PHP supports this natively? |
Hi! Lot of time without posting, I'm sorry. Wquer555 I didn't understand the comment you did 15 days ago D: I'm sorry, I'm not an expert with php, last time I got some help with a cousin that came at home hehe |
Bump. I got the same problem. It happens a month ago when host decided to disable
New solution? Maybe switch or fallback to native PHP when cc @tslocum Addendum:
Time to stick to PHP |
For security reason, most shared hosting disable these function. tslocum#28 Error log: https://p.teknik.io/jPZHF
Thanks @indrakaw, I've merged your commits and tweaked the function to fall back to file_get_contents if cURL isn't installed. |
I've seen there's a similar Issue but with WebM, but I don't know if the solution is different in this case...
When i try to upload an image (I tried with many different images in jpg, png or gif) I get this error "Supported file types are JPG, PNG and GIF"...
Any ideas?
The text was updated successfully, but these errors were encountered: