The discussion revolves around the issue of images being uploaded in a random order, rather than the order they were selected in. ron_jeremy initially reported the issue and sam acknowledged it as a reasonable feature request.
codinghorror investigated the issue and found that the operating system, not the web browser, is responsible for the file order. The issue arises because the operating system does not respect the order in which files are selected. codinghorror discovered that Windows tends to send files in a weird order, and the only way to get the files in the correct order is to select them in reverse order of number.
Remah further investigated the issue and found that the file selection behavior is not specific to the web browser, but rather a common problem in many applications. The order of upload completion also seems to play a role in determining the final order of the images.
sam proposed a solution to the issue by redoing the image placeholders to include a sequence number, which would allow the images to be inserted into the post in the correct order. sam confirmed that this change would be implemented in a future update, but clarified that it would not change the order in which the operating system sends the files. Instead, it would simply ensure that the images are inserted into the post in the correct order, regardless of upload speeds.
Is it possible to have images that are uploaded & inserted into a post to appear in order by filename?
For example: if I select the following images (1.jpg, 2.jpg, 3.jpg, 4.jpg, 5.jpg) on my computer & upload them into a post (using the editor’s file upload icon) they seem to be inserted in a random order (it’s not by filename or size). This makes inserting images into “How To” posts or tutorials or anything where a timeline needs to be preserved very tedious because images would have to be inserted one at a time in order to preserve the coherency of the post.
Is this a CP setting I’ve missed or just the way things are?
Interesting use case, I think it is a reasonable feature request to sort by name if you are trying to upload multiple things. Though I wonder “if this is the correct default” why is the operating system not taking care of it?
Here’s another example of what I’m trying to explain: if I use my camera to take pics during a 7 day motorcycle ride, all those pics will be sorted by filename (DSC_001, DCS_002, etc.) which presents the chronological order the pics were taken. What I’d like to see is simply for that order to be preserved when selecting those pics & uploading them into a post.
That is usually the case. For example there’d by a GoPro folder with a bunch of images sorted by filename (and thus by timestamp). Selecting 20 images to create a ride report for a multi day ride doesn’t yield the correct chronological order where one could simply add a gap between each image & enter whatever relevant text applies then move on to the next image.
Every image would need to be inserted one. at. a. time.
Let me try shift-selecting all images in this folder. Here goes, shift-select the range.. wait, I already see a problem! Note the circled area in the screenshot:
Now let me try again shift+clicking each one.. wow nope! No change! Windows apparently really wants those files sent in that weird order, maybe it’s a “human sort” issue? Let me try renaming them.. wow! Nope!
Hi @codinghorror, I didn’t mean to imply it’s an issue with Discourse. Is there a possible “fix” from the Discourse side of things where attachments could be displayed in order of filename? Apologies if I’m asking for the moon here – it’s just my ignorance talking.
Yes, I fully understand that. I can tell my users to shift-click & (hopefully) remember to select images in a backwards oder, but I was hoping maybe Discourse could handle this automagically in a future update.
Now that I think of it, I notice the same behaviour when copying files to my NAS. If I select an album folder with a bunch of MP3 files (01 - song title.mp3, 02 - song title.mp3, etc.) they also seem to “land” on the server in random order.