Notifications
Clear all

Upper / Lowercase Issue for File Extensions

2 Posts
2 Users
0 Likes
1,642 Views
Posts: 18
Customer
Topic starter
(@carstenmeiselbach)
Member
Joined: 8 years ago

Hello wpDiscuz Media Uploader-Team!

For UNIX OS environments, which is truly most the case for most hosted Servers, Files / Images uploaded not correctly handled afterwards.

Image itself is presented correclty, but the larger version of the Image, opened by a click on the Image, fails regulary because of the differently written extension.

Example:
Image stored on the Server is named
wp-content/uploads/2018/02/20180224_184857_22504_1.JPG
(Upper Case extension)
Image linked is named
wp-content/uploads/2018/02/20180224_184857_22504_1.jpg
(Lower Case extension)

=> resulting into HTTP 404 on Unix / Linix OS.

My currenty workaround:

== wpdiscuz-media-uploader\class.WpdiscuzMediaUploader.php
$ext = pathinfo($fName, PATHINFO_EXTENSION);
=>
// Stores files with Lower Case Extension.
$ext = strtolower(pathinfo($fName, PATHINFO_EXTENSION)); == wpdiscuz-media-uploader\utils\class.WMUHelper.php
$url = wp_get_attachment_url($attachment->ID);
=>

// Set file name extension to Lower Case.
$url = wp_get_attachment_url($attachment->ID);
$filetype = wp_check_filetype($url);
$url = str_replace(".".$filetype['ext'], ".".strtolower($filetype['ext']), $url);

===
So I'm doing this update currently for all new versions of your Plugin.
There is warning: all files written in the past with Upper Case extension, which are part of the upload-directory, are still coming with this extension. They need to being renamed first...

I assume that your testing your Plugin within your Localhost Windows environment. So you will never experience this problem here. Better to make the Q/A on Linux Servers too...

Best regards,

Carsten

1 Reply
Astghik
Posts: 5911
Admin
(@astgh)
Illustrious Member
Joined: 6 years ago

We've already fixed this problem. Please wait for the next update, it's coming very soon.

Reply
Share:
Scroll to top