Jump to content
thirty bees forum

Attachment Filename Description character lenght


Recommended Posts

Posted

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

  • Like 2
Posted
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..

Posted

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

 

 

Posted
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.

Posted (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 by dynambee
Posted
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

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...