Python. Unzip archive to which the filenames are encoded using urlencode, and because of the encoding, the length of some names is > 260

23 Views Asked by At

Creating a backend on FastApi. Post request, the bytes string is received. After that, I create a zip archive from this line. But the file names are encoded using url encoding.

data: bytes - bytes строка

with open("name.zip", 'wb') as f:
f.write(data)

I will get these File names > 260 characters, which is why the archive is not unpacked File names > 260 characters

I tried to look for bad names, decode them and replace them in a byte string with the correct ones. After that, the archive is destroyed.

As I know, you cannot change the names inside the archive. I can't figure out how to solve this problem.

0

There are 0 best solutions below