XFileSharing Pro - is it possible to add sitename to filename after download?

Message
Author
hscorp
Posts: 143
Joined: Nov 12, 2008 5:36 pm

is it possible to add sitename to filename after download?

#1 Postby hscorp » Jan 01, 2009 5:57 pm

the file name for example is

test.zip

when u download it the script renames it to

sitename.com_test.zip

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Jan 12, 2009 10:19 am

In index.cgi find

Code: Select all

$file->{fsize} = $ses->makeFileSize($file->{file_size});
and add below:

Code: Select all

$file->{file_name} = "sitename.com_$file->{file_name}";

hscorp
Posts: 143
Joined: Nov 12, 2008 5:36 pm

#3 Postby hscorp » Jan 12, 2009 4:05 pm

thanks for your reply but it doesn't work

when i choose file to download for example as this pic

Image

you'll go to this page to create the link and the file will be with sitename like this picture

Image

but after you'll get the link without sitename

Image


but really thanks for your reply wating if there is any solution

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#4 Postby PilgrimX182 » Jan 13, 2009 2:02 pm

oh, then undo the change I've told you and do this:
in fs.cgi find

Code: Select all

$filename=~s/[^\w\d\.-]/_/g if $c->{sanitize_filename};
and add below:

Code: Select all

$filename = "sitename.com_$filename";
this should update filename everywhere.

hscorp
Posts: 143
Joined: Nov 12, 2008 5:36 pm

#5 Postby hscorp » Jan 13, 2009 5:23 pm

yea this works fine with newly uploaded files

but two problems

1- what about already uploaded files?
2- what if i changed the domain name or i want to remove it.

:D thanks

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#6 Postby PilgrimX182 » Jan 14, 2009 7:24 am

What if godzilla will raise again? :)

1) No idea what's the problem you mean.
2) Then change domain there too or remove it. It's FREE QUICK hack, what do you want else?