3 ms·
You should not be using anything other than UUIDs or integers for file names. Maintain your own mapping in a database or file. Using a network value or a value
by xenadu02 10y ago
You should not be using anything other than UUIDs or integers for file names. Maintain your own mapping in a database or file.
Using a network value or a value returned by an API is just asking for trouble.
If a user names a file that will be hidden behind a URL the same advice applies. If not then the user can use any sequence of bytes they want and you shouldn't care.
- astrange 10y agoIt's poor UI to not name a file on the user's own machine, if they'll ever have to look at it. I'm counting things like web browser caches in this because OmniDiskSweeper/etc users will be seeing the large files you put in there.
- madeofpalk 10y agoMost importantly, APFS is first being rolled out to iOS where this isn't as much of a problem because the user never really sees the filesystem anyway.
- eptcyka 10y agoIt doesn't matter much on iOS, where users rarely if at all have to access the filesystem directly. It is very rare that the same files would be accessed and modified by more than a single application anyway.
- _jal 10y agoAssuming your application is the only app that will ever interact with a file is only correct in very specific circumstances. This is terrible advice in the general case.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]