XFileSharing Pro - Leaving spaces in filename and url

Message
Author
jeyul
Posts: 51
Joined: Feb 17, 2009 8:14 am

Leaving spaces in filename and url

#1 Postby jeyul » Feb 17, 2009 8:17 am

Hello, I've got a problem with my script. Not really a problem but I can't figure it out how to make the change I want. I want to leave the white spaces in the filename and not replace them with underscore. Can you help me with it? Thank you in advance

sherayusuf3
Posts: 94
Joined: Jan 18, 2009 4:29 am

Re: Leaving spaces in filename and url

#2 Postby sherayusuf3 » Feb 17, 2009 9:13 am

jeyul wrote:Hello, I've got a problem with my script. Not really a problem but I can't figure it out how to make the change I want. I want to leave the white spaces in the filename and not replace them with underscore. Can you help me with it? Thank you in advance
i think it could be hard changing, because u must change in save files function and call a file function. And i think that's need a large effort.

jeyul
Posts: 51
Joined: Feb 17, 2009 8:14 am

#3 Postby jeyul » Feb 17, 2009 9:19 am

I don't think it will be that hard ... I read a older post on the forum and the solution was editing the fs.cgi but I don't find the required field in my fs.cgi. It must have something to do with file_name_orig or filename in the fs/uploads.cgi . I know that there is function that replaces the white spaces and I think if I could manage to delete it then it should work but I can't manage to find the function so I'm waiting for a developers response :D



P.S. : I'm using XFilesharing pro 1.1

@Later edit :

Solved :D . I'll post down the solution for the ones who need it :)

In uploads.cgi find $fhash{file_name_orig}=~s/[^a-zA-Z0-9-_\.]/_/gs;
and replace it with $fhash{file_name_orig}=~s/[^a-zA-Z0-9-_\.]/ /gs;
*If you want another character to replace the white spaces you can add it between the slashes before gs ( / character/gs ).