Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Upload function can't handle long file names #12889

Closed
freder opened this issue Mar 14, 2023 · 3 comments
Closed

[4.x]: Upload function can't handle long file names #12889

freder opened this issue Mar 14, 2023 · 3 comments
Assignees

Comments

@freder
Copy link

freder commented Mar 14, 2023

What happened?

Description

apparently the upload function can't handle long-ish file names.

Steps to reproduce

  1. try uploading a file with a long name: eyJidWNrZXQiOiJhcmVuYV9pbWFnZXMiLCJrZXkiOiIxMDg2MTk3Ny9vcmlnaW5hbF85MjE5ZmZmMmIxNDM1OTFiZmE2NzZmYjk1NWJjOWEyYy5qcGciLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjYzMCwiaGVpZ2h0Ijo2MzAsImZpdCI6Imluc2lkZSIsIndpdGhvdXRFbmxhcmdlbWVudCI6dHJ1ZX0sIndlYnA.jpeg

Expected behavior

should upload fine.

does in fact work, when I rename the file to test.jpg

Actual behavior

image

Craft CMS version

4.4.1

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

@freder freder changed the title [4.x]: [4.x]: Upload function can't handle long file names Mar 14, 2023
@i-just
Copy link
Contributor

i-just commented Mar 15, 2023

Hi, thanks for reaching out. This isn’t so much Craft not being able to handle long filenames as it is a limitation dependent on the OS. If the filename exceeds what the OS can work with, PHP won’t move (or copy) the file.

That being said, we will discuss possible options internally.

@brandonkelly brandonkelly self-assigned this Mar 15, 2023
brandonkelly added a commit that referenced this issue Mar 15, 2023
Max filename length is 255, but Raster::_autoGuessImageQuality() was appending "-temp" bringing it down to 250.

Fixes #12889
@brandonkelly
Copy link
Member

I was able to reproduce this locally, and got it fixed for the next Craft 3 and 4 releases.

@brandonkelly
Copy link
Member

3.8.3 and 4.4.3 are out with that fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants