Author Topic: Remove UTF8 characters from file names  (Read 1076 times)

sandomatyas

  • Jr. Member
  • **
  • Posts: 231
Remove UTF8 characters from file names
« on: December 02, 2016, 12:16:13 pm »
My customer uploaded some products images with space and accented characters in the file name. It was stored with this name to the image directory and the #__virtuemart_medias table but there some browsers which can't handle this properly and even PHP has some difficulties with that.
Is there a way to disable using special characters in file names?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9720
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Remove UTF8 characters from file names
« Reply #1 on: December 02, 2016, 22:50:21 pm »
It is more or less just some lines and an option, an hidden one would be enough
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sandomatyas

  • Jr. Member
  • **
  • Posts: 231
Re: Remove UTF8 characters from file names
« Reply #2 on: September 20, 2017, 09:17:21 am »
is there any progress with this?

sandomatyas

  • Jr. Member
  • **
  • Posts: 231
Re: Remove UTF8 characters from file names
« Reply #3 on: January 18, 2018, 13:41:21 pm »
? :)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3459
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Remove UTF8 characters from file names
« Reply #4 on: January 18, 2018, 15:21:48 pm »
If you upload files with Joomla, Virtuemart or my tool VM Be Pro, the files are renamed correctly to prevent such problems.
If you upload files directly, rename your files before upload is the only safe solution.

sandomatyas

  • Jr. Member
  • **
  • Posts: 231
Re: Remove UTF8 characters from file names
« Reply #5 on: January 19, 2018, 09:34:12 am »
I uploaded an image to a product (Joomla 3.8.3, VM 3.2.12) via VirtueMart and the special characters are still there
https://snag.gy/FkuXTo.jpg

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3459
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Remove UTF8 characters from file names
« Reply #6 on: January 19, 2018, 13:03:15 pm »
Hum, i was thinking, this are always safe.
So best, is to rename it before upload.

sandomatyas

  • Jr. Member
  • **
  • Posts: 231
Re: Remove UTF8 characters from file names
« Reply #7 on: January 19, 2018, 13:32:50 pm »
I can rename sure but it would be better if VM could handle it. I could use a new settings option for that: would you like to use web-safe file names yes/no :)

sandomatyas

  • Jr. Member
  • **
  • Posts: 231
Re: Remove UTF8 characters from file names
« Reply #8 on: July 03, 2018, 07:25:52 am »
I can rename sure but it would be better if VM could handle it. I could use a new settings option for that: would you like to use web-safe file names yes/no :)

@Milbo maybe? :/

I had to restore a backup where VM had utf8 filenames and this is what I got:
https://snag.gy/FhmAs6.jpg

I know, it's the server but there would be an option to use web-safe file names, it wouldn't be a problem.