Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you remove special characters before uploading a file in Rails?

I'm using Carrierwave x Rails. Basically, I'm facing some problems with Amazon S3 string matching & I think it would just be easier to remove all the special characters, such as brackets & accents, (and spaces) before uploading the file.

So, what I'd like to know is how do you remove special characters from a file's filename before uploading the file in rails?

Thank you in advance


Solved. For anyone else who's facing the same or similar problem, read my solution in my answer below. Cheers :)

like image 669
goo Avatar asked Jan 22 '26 16:01

goo


1 Answers

Check out the parameterize method here.

like image 51
t56k Avatar answered Jan 26 '26 17:01

t56k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!