Hi
I have a problem with the downloading of images by the user. As the user clicks on the icon for downloading an image, the images comes in the navigator as text. I debug the PHP and find the source of the problem. It is the line 148 in the file action.php which contains $ctype = mime_content_type($file);. I tried to comment the line and everything works correctly.
I read in the documentation of PHP, that the function is deprecated. This documentation says that now it better to use the extension PECL Fileinfo.
I hope that this bug report can help you.
Just a thing before closing: piwigo is fantastic
Sincerely you
Pierre-Olivier
**Reported by povpiwigo on 22 Mar 2011 08:15**
**Version:** 2.1.4
Hi
I have a problem with the downloading of images by the user. As the user clicks on the icon for downloading an image, the images comes in the navigator as text. I debug the PHP and find the source of the problem. It is the line 148 in the file action.php which contains $ctype = mime_content_type($file);. I tried to comment the line and everything works correctly.
I read in the documentation of PHP, that the function is deprecated. This documentation says that now it better to use the extension PECL Fileinfo.
I hope that this bug report can help you.
Just a thing before closing: piwigo is fantastic
Sincerely you
Pierre-Olivier
[Piwigo Bugtracker #2227](http://piwigo.org/bugs/view.php?id=2227)
<!-- github-sync-id:97252271 -->
I think the problem is solved in Piwigo 2.8 (and certainly earlier), because we do something like
$ctype = null;
if (!url_is_remote($file))
{
if ( function_exists('mime_content_type') )
{
$ctype = mime_content_type($file);
}
...
if (!isset($ctype))
{ // give it a guess
$ctype = guess_mime_type( get_extension($file) );
}
$http_headers[] = 'Content-Type: '.$ctype;
I think the problem is solved in Piwigo 2.8 (and certainly earlier), because we do something like
```
$ctype = null;
if (!url_is_remote($file))
{
if ( function_exists('mime_content_type') )
{
$ctype = mime_content_type($file);
}
...
if (!isset($ctype))
{ // give it a guess
$ctype = guess_mime_type( get_extension($file) );
}
$http_headers[] = 'Content-Type: '.$ctype;
```
<!-- github-comment-id:231603406 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reported by povpiwigo on 22 Mar 2011 08:15
Version: 2.1.4
Hi
I have a problem with the downloading of images by the user. As the user clicks on the icon for downloading an image, the images comes in the navigator as text. I debug the PHP and find the source of the problem. It is the line 148 in the file action.php which contains $ctype = mime_content_type($file);. I tried to comment the line and everything works correctly.
I read in the documentation of PHP, that the function is deprecated. This documentation says that now it better to use the extension PECL Fileinfo.
I hope that this bug report can help you.
Just a thing before closing: piwigo is fantastic
Sincerely you
Pierre-Olivier
Piwigo Bugtracker #2227
I think the problem is solved in Piwigo 2.8 (and certainly earlier), because we do something like