Petter Posted September 24, 2019 Posted September 24, 2019 When using attachments to products in prestashop 1.6x there is a limitation for max 32 characters for filename and characters. This is very annoying and will have to be manually changed in the database an template to be updated to an acceptable length. I just tried the Thirtybees admin demo and the same problem exist in Thirty bees(admin demo) This value should by default be changed to something like 128 characters or more. If you just have a few attachments stored you can maybe do with the default 32 characters, but if you have hundred of attachments or more it is impossible to give them meaningful names so you can chose correct attachment to a product form existing attachments.attachment to a pr 2
SLiCK_303 Posted September 25, 2019 Posted September 25, 2019 You sound like you made the modifications needed to do this on a ps 1.6 site? If so, maybe you should do a pull request on tb... 1
shoptechmedia Posted September 25, 2019 Posted September 25, 2019 9 hours ago, Petter said: When using attachments to products in prestashop 1.6x there is a limitation for max 32 characters for filename and characters. This is very annoying and will have to be manually changed in the database an template to be updated to an acceptable length. I just tried the Thirtybees admin demo and the same problem exist in Thirty bees(admin demo) This value should by default be changed to something like 128 characters or more. If you just have a few attachments stored you can maybe do with the default 32 characters, but if you have hundred of attachments or more it is impossible to give them meaningful names so you can chose correct attachment to a product form existing attachments.attachment to a pr Agree.. thank you sharing.. and like @SLiCK_303 said.. you could do a pull request on TB..
dynambee Posted September 25, 2019 Posted September 25, 2019 The best part is the hovertext though so go to XKCD and hover over the comic. (On iOS if you long-press on the image the hovertext will pop up. Android is probably the same.)
zen Posted September 25, 2019 Posted September 25, 2019 Well, in my experience with some shops having a lot of uploaded files it never was a problem.. 32 caracters is a lot !! It makes (26+10+12)^32 = 6.305501e+53 different names possible. I guess going to 64 will make it readable even more for complex filenames, but 128 is really too much, way too much, and maybe will break compatibility on some servers settings quote : "I would like to clarify, that linux has a 255 bytes limit per filename, not 255 characters. This is a significant difference and if you use e.g. UTF-8 encoding, you may end up with filenames of 100 characters max." https://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs SO, OK to upgrade to 64 caracters maximum... but no more is needed I think
dynambee Posted September 25, 2019 Posted September 25, 2019 18 minutes ago, zen said: Well, in my experience with some shops having a lot of uploaded files it never was a problem.. 32 caracters is a lot !! It makes (26+10+12)^32 = 6.305501e+53 different names possible. 32 characters is a lot of combinations but not very many characters for descriptive filenames. 21 minutes ago, zen said: "I would like to clarify, that linux has a 255 bytes limit per filename, not 255 characters. This is a significant difference and if you use e.g. UTF-8 encoding, you may end up with filenames of 100 characters max." Yes, 255 bytes per filename and max 4096 bytes for the entire path. However UTF8 is a variable length encoding system. A-Z a-z 0-9 and other basic English characters fall into single byte encoding. So if someone is using English filenames then up to 255 characters is fine. However if you get into other alphabets each character can take between 1 and 4 bytes, depending on the alphabet and the character. Fun stuff. So the TB platform itself can probably increase the filename safely to 63 characters. If specific users wish to increase it beyond that then they need to be aware that they could run into problems depending on the alphabets they use.
dynambee Posted September 25, 2019 Posted September 25, 2019 (edited) 64x4=256 bytes. 255 bytes is the maximum, probably because the string is null terminated using up that extra byte. Edit: Or to put it another way, 63 characters instead of 64 for the same reason it's 255 bytes and not 256. 😉 Edited September 25, 2019 by dynambee
zen Posted September 25, 2019 Posted September 25, 2019 1 minute ago, dynambee said: 64x4=256 bytes. 255 bytes is the maximum, probably because the string is null terminated using up that extra byte. yes, sorry.. and that was the answer under the one i quoted... oups Quote 63 is the max if every character uses the max encoding of 4 bytes per code point. This is the same for any of the UTF schemas (UTF-16 and UTF-32) – Rahly May 30 '16 at 19:35
dynambee Posted September 25, 2019 Posted September 25, 2019 No problem. I live in Japan and have been dealing with multi-byte characters for nearly 30 years. 🙂
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now