Author Topic: About Rename during Upload  (Read 8776 times)

0 Members and 1 Guest are viewing this topic.

Offline sunl

  • Newbie
  • *
  • Posts: 20
    • View Profile
About Rename during Upload
« on: January 27, 2011, 11:03:12 PM »
Hello Friends    :)

I have problem to solve it will be great help if any one can solve it.

Actually it is related to rename images during upload.

If i upload image through ftp it change capital letters to small letters like this

Megan Fox 1 --> megan_fox_1.jpg

But if i upload through http (through site ) it not change Capital letters to small letter. It change like this

Megan Fox 1 --> Megan_Fox_1.jpg

I want that it also change name through http like this

Megan Fox 1 --> megan_fox_1.jpg

I am not able to find how to do this. Please Help

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: About Rename during Upload
« Reply #1 on: January 28, 2011, 12:53:21 AM »
What 4images version do you use?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sunl

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: About Rename during Upload
« Reply #2 on: January 28, 2011, 03:12:29 PM »
Its Latest Version 1.7.9

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: About Rename during Upload
« Reply #3 on: March 16, 2012, 09:54:25 AM »
I am facing the same issue, files get renamed when i add images through "Check new images" option(uploaded via FTP). After adding, files are Case changed and space( ) between a name is replaced with underscore(_)
for example: Anushka Sharma 10.jpg is renamed to anushka_sharma_10.jpg

Quote
Working on data/media/2/Anushka Sharma 10.jpg file
File renamed from Anushka Sharma 10.jpg to anushka_sharma_10.jpg
Thumbnail created.
Image resized.
Image added: Anushka Sharma 10

is there any way to disable it?

btw I am using 1.7.10.
« Last Edit: March 16, 2012, 11:32:25 AM by yousaf »

Rembrandt

  • Guest
Re: About Rename during Upload
« Reply #4 on: March 16, 2012, 01:16:15 PM »
I am facing the same issue, files get renamed when i add images through "Check new images" option(uploaded via FTP). After adding, files are Case changed and space( ) between a name is replaced with underscore(_)
for example: Anushka Sharma 10.jpg is renamed to anushka_sharma_10.jpg
....
this is correct...
Reserved characters and words

mfg Andi

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: About Rename during Upload
« Reply #5 on: March 17, 2012, 01:51:03 AM »
I would highly recommend leave it as is, especially if you are a Windows user and one day you might decide copy your website, which most probably a linux system, to your computer.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sathishIPL

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: About Rename during Upload
« Reply #6 on: March 17, 2012, 01:38:11 PM »
I would highly recommend leave it as is, especially if you are a Windows user and one day you might decide copy your website, which most probably a linux system, to your computer.

As v@no said, leave as it is.  Its a good pratice for SEO by naming a image without space
(eg--> Anjelian-jolie.jpg)

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: About Rename during Upload
« Reply #7 on: March 19, 2012, 02:13:08 PM »
You all are right, but my case is different i am not using 4images for Wallpapers or images, the nature of my site is different i serve files and those files should be the same as they are listed on the site. 1.7.10 is currently my beta and on my live site I still have an older version and now i want to move on with the latest version but this issue is keeping from doing so,
Is there any way to turn it off? please

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: About Rename during Upload
« Reply #8 on: March 20, 2012, 03:38:30 AM »
In includes/upload.php remove:
Code: [Select]
     $this->file_name = str_replace(" ", "_", $this->file_name);
      $this->file_name = str_replace("%20", "_", $this->file_name);
      $this->file_name = preg_replace("/[^-\._a-zA-Z0-9]/", "", $this->file_name);
(it's still a bad idea. The best way to go around this is to store original filename in database and send that filename when file being download)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)