Page MenuHomePhabricator

When creating a file by downloading a URI, truncate the length of the default name
ClosedPublic

Authored by epriestley on Apr 12 2018, 6:14 PM.
Tags
None
Referenced Files
F19819219: D19353.diff
Mar 6 2026, 4:23 AM
F19065516: D19353.id.diff
Nov 30 2025, 2:21 AM
F19059991: D19353.diff
Nov 29 2025, 7:27 AM
F19029648: D19353.id.diff
Nov 24 2025, 6:37 PM
F18995228: D19353.id.diff
Nov 19 2025, 4:26 PM
F18840320: D19353.diff
Oct 27 2025, 11:31 PM
F18833326: D19353.id.diff
Oct 26 2025, 2:35 AM
F18830542: D19353.diff
Oct 25 2025, 7:22 AM
Subscribers
None

Details

Summary

See https://discourse.phabricator-community.org/t/embedding-external-images-url-show-error-for-long-urls/1339.

When we download a file from a URI, we provide a default name based on the URI. However, if the URI is something like http://example.com/very-very-very-....-long.jpg with more than 255 characters, we may suggest a name which won't fit into the name column of PhabricatorFile.

Instead, suggest a default name no longer than 64 bytes.

Test Plan
  • Used the {image ...} example from the Discourse report locally; got an image with a truncated name.
  • Used a normal {image ...}, got an image file with a normal name.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable