Alex Robert
Alex Robert

Reputation: 31

How to convert a filename with special chars to be acceptable by all OSs?

I'm creating a cloud storage-like system where users can create files and folders.

The problem is when the files/folders have a special char and/or reserved word in the name.

The original name of the file/folder is being saved in the database but how to overcome the creation of this file/folder in the filesystem, considering all different operating systems?

For instance a filename with /.

Upvotes: 1

Views: 45

Answers (1)

Rafał Łyczkowski
Rafał Łyczkowski

Reputation: 1015

Try use slugify script like this one: https://github.com/kevinlebrun/slug.php

Upvotes: 1

Related Questions