• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

file names are too long! how to shorten them?

goofball

Chevereto Noob
I have the file naming method for uploaded pictures set to "random number". (Dashboard, Image Upload, File Naming Method)

but the filenames are too long. like 13w49up9ath2ejrjfewxn5xwp6xpf3hc.jpg

I think the string does not have to be 32 characters long. here's why.

when a character can be a-z (lowercase) or 0-9, there are 26+10=36 possibilities.

so when a string is 32 characters long, that means the number of possible combinations is 32 to the 36th power, or something like the number of grains of sand in the universe.

the string doesn't have to be that long.

how long should it be? 5 characters? 10? 15? 20?

well however long the string is, it will always be to the 36th power. so it's easy to see what this is going to look like.

1^36 = 1

2^36 = 68,719,476,736

3^36 = 150,094,635,297,000,000

4^36 = 4,722,366,482,870,000,000,000

so when the string is only 4 characters long, there are more than 4 sextillion possible combinations. nobody is ever going to randomly make the same filename.

I would think that only 2 characters are good enough, having 68 billion combinations. but that would simply look inadequate having pictures named y3.jpg or 5w.jpg

a short string, like 5 characters long, should work just fine and look okay too. like 4ld7n.jpg

I looked for a random character generator in the code, and i think I found it in /app/lib/chevereto.js and chevereto.min.js

all the way at the end it says:

// Queuezier!

CHV.fn.queuePixel = function() {

var img = '<img data-content="queue-pixel" src="'+ PF.obj.config.base_url + '?queue&r=' + PF.fn.generate_random_string(32) +'" width="1" height="1" alt="" style="display: none;">';

$("body").append(img);

};

so I changed PF.fn.generate_random_string(32) to PF.fn.generate_random_string(5) but still got filenames 32 characters long.

how do you change the length of the random string?
 
I agree, 32 characters seems very long.

When combined with an embed code the resulting url is enormous 🙂
 
The length (32 chars) is ridiculous large to avoid people guessing filenames, the shorter the name the easiest gets to guess filenames out of nothing. True, 32 is too much for humans, but fair enough for machines.

This is not about making the name unique, but obscure the files using a very large name making it impossible to guess and foolish to program a scraper for it. Is just too big, the way it should be.

ID based filenaming is consecutive rather than randomized, it grows with your website and it can be reversed (get the actual DB row ID). The system uses your unique crypt salt (8 char length random string) and the real numeric ID to generate the alphanumeric representation of that number. It also adds 5000 to the base numeric value (padding) so the encoded IDs aren't that shorter either. The only downside of this approach is that is easier to enumerate (just because the result is shorter) but with time it will grow to n-chars making it very hard to guess anyway.
 
Back
Top