Image File Name Shortened (Truncated) by WordPress
-
I thought to post this one to WordPress in-case others have the same issue.
Problem
Uploading an image, WordPress truncates (shortens) the image name to something like, “imagenam~.jpg”.This then seems to not make sense because before, you have experienced the same length image name show as accepted by WordPress, but suddenly WordPress shortens it, so Why?
Fix
Move the image to the desktop, then try uploading it again. If WordPress still shortens it, then move it to a temp folder at the root “C:\”, which shortens the file path to the bare bones length. Try again, if the same issue appears, rename the image so the image file name is shorter.Reason
It has to do with one or both limitations of Windows. The depth of the folder (file path) and/or the length of the file name itself. The file name length per Windows limit, I believe, is about 256 characters, including spaces.The culprit most of the time, in my experience, is the depth of the file location. Too many sub-folders will cause this issue, even if the file name is already short. The moving of the image file to the desktop or to a temp folder at the root (C:\) will resolve the issue.
As I understand Windows, the depth of the file (sub-folder location) has a bearing on how large the file name can be. This means the file name character limit of 256 characters gets less and less the deeper the file is located.
Also, if the folder name itself is longer or long, that also has an impact on the file name length of files within that folder.
As I have experienced, WordPress image library upload is also affected the same way.
As a note, FTP uploads are also affected the same way, if you find a file was not accepted during the upload or its file name was shortened, then the depth of the file location was likely the cause.
Question to WordPress Support
What is the limit to an image file name length per WordPress? – is it the same as Windows or different?
- The topic ‘Image File Name Shortened (Truncated) by WordPress’ is closed to new replies.