hello,
im already search this forum not found same with my case
1. how to create diffrent port when generate download lin
example :
when people click download file, the link format is or after upload file :
http://site.com/1h2b34j24j2/name-file.zip
how to costumize adding port after site.com like
http://site.com:8000/1h2b34j24j2/name-file.zip
2. how to adding site url on file when user upload
example :
origin file name is : name-file.zip
after upload n when user download file rename with site url like site.com_name-file.zip
thnks
XFileSharing Pro - generate download link with deffrent port website
-
- Posts: 94
- Joined: Jan 18, 2009 4:29 am
-
- Posts: 94
- Joined: Jan 18, 2009 4:29 am
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
In index.cgi replace
with
where 8080 - your port.
Should do the trick.
Code: Select all
return "$file->{srv_htdocs_url}/$ddcode/$fname";
Code: Select all
return "$file->{srv_htdocs_url}:8080/$ddcode/$fname";
Should do the trick.
-
- Posts: 94
- Joined: Jan 18, 2009 4:29 am
PilgrimX182 wrote:In index.cgi replacewithCode: Select all
return "$file->{srv_htdocs_url}/$ddcode/$fname";
where 8080 - your port.Code: Select all
return "$file->{srv_htdocs_url}:8080/$ddcode/$fname";
Should do the trick.
not work
http://site.com/files:8000/1/h2b34j24j2/name-file.zip
It did not work because you have the htdocs_url as ...files
what you can do is either just add the htdocs url in the fileserver edit menu as :8000 and leave the cgi bin on the normal poort, or try this modification I use for having premium users download from a different poort and htdocs url.
in index.cgi find
change to;
downside is that you have to put in elsif's for every fileserver you want a different port or path to files for...
Also to do different stuff for premium users you can use
Hope this helps...
what you can do is either just add the htdocs url in the fileserver edit menu as :8000 and leave the cgi bin on the normal poort, or try this modification I use for having premium users download from a different poort and htdocs url.
in index.cgi find
Code: Select all
$file->{direct_link} = "$file->{srv_htdocs_url}/$ddcode/$file->{file_name}";
Code: Select all
if($file->{srv_htdocs_url} eq "http://fileserver20.something.com/files")
{
$file->{direct_link} = "http://fileserver20.something.com:8000/files/$ddcode/$file->{file_name}";
}
else
{
$file->{direct_link} = "$file->{srv_htdocs_url}/$ddcode/$file->{file_name}";
}
Also to do different stuff for premium users you can use
Code: Select all
if($premium)
{
Hope this helps...
-
- Posts: 94
- Joined: Jan 18, 2009 4:29 am
I have done it using else-if statementssherayusuf3 wrote:Thnks Naga, how about multiple server?
how to define
Code: Select all
if($file->{srv_htdocs_url} eq "http://fileserver20.something.com/files")
{
$file->{direct_link} = "http://fileserver20.something.com:8000/files/$ddcode/$file->{file_name}";
}
elsif($file->{srv_htdocs_url} eq "http://fileserver21.something.com/files")
{
$file->{direct_link} = "http://fileserver21.something.com:8000/files/$ddcode/$file->{file_name}";
}
else
{
$file->{direct_link} = "$file->{srv_htdocs_url}/$ddcode/$file->{file_name}";
}