| View previous topic :: View next topic |
| Author |
Message |
INTERNOZEROUNO
Joined: 23 Mar 2011 Posts: 8
|
Posted: Mar 23, 2011 7:30 pm Post subject: Adding a direct download link to confirmation email messages |
|
|
Hi, recently I bought the last version of this script and think it's very useful. I'd like to put a link in confirmation email in order to let people download the file directly, but don't know how to create it. Every uploaded file shoud have that link in addition to the other parameters like name, size, status...
I tried so many ways, but I am not a skilled programmer and need some help, please. Tell me everything like you're talking to a 6 y.o. child. I don't need to understand, just make it work. |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1281
|
Posted: Mar 24, 2011 7:03 am Post subject: |
|
|
We would never try to teach 6 y.o child programming.
You'd better hire programmer to do that. |
|
| Back to top |
|
 |
INTERNOZEROUNO
Joined: 23 Mar 2011 Posts: 8
|
Posted: Mar 24, 2011 9:34 am Post subject: |
|
|
| admin wrote: | We would never try to teach 6 y.o child programming.
You'd better hire programmer to do that. |
C'mon dude, that was just a way of saying, obviously I meant "use simple words and be as clear as possible", 'cause I'm not a professionist of perl programming, and English is not my first language. Do you take everything so literally?!
Anyway I found out the solution by myself and now I am pridely going to tell you what you have to do in case you are 6 y.o. and reading this thread looking for help.
1. Open XUploadConfig.pm and choose a "uploads" dir outside from cgi-bin folder, like this example:
| Code: | # Directory for uploaded files
target_dir => '/web/htdocs/www.your-site-name.com/home/uploads/',
|
2. Create "uploads" folder in your site's root with 777 permissions.
3. Open upload.cgi and find this code:
| Code: | my $fhash;
$fhash->{field_name}=$k;
$fhash->{file_name_orig} = $filename;
$fhash->{file_descr} = $cg->param("$k\_descr");
$fhash->{file_mime} = $cg->uploadInfo($u)->{'Content-Type'};
|
Edit this way:
| Code: | my $fhash;
$fhash->{field_name}=$k;
$fhash->{file_link}=$ext_folder."/";
$fhash->{file_name_orig} = $filename;
$fhash->{file_descr} = $cg->param("$k\_descr");
$fhash->{file_mime} = $cg->uploadInfo($u)->{'Content-Type'};
|
Find this:
| Code: | | my @file_fields = qw(file_name file_name_orig file_status file_size file_descr file_mime); |
Edit in:
| Code: | | my @file_fields = qw(file_link file_name file_name_orig file_status file_size file_descr file_mime); |
Save.
4. Open confirm_email.html and add this code inside the file details table, where you want to see the download link:
| Code: | | <TR><TD><b>DOWNLOAD:</b></TD><TD><b><a href="http://www.your-site-name.com/uploads/<TMPL_VAR file_link><TMPL_VAR file_name>">http://www.your-site-name.com/uploads/<TMPL_VAR file_link><TMPL_VAR file_name></a></b></TD></TR> |
Save.
Note: this solution works with ext_folder and even if your files go directly into "uploads" folder!
Hope it's useful for someone. Good luck! Ciao!
Last edited by INTERNOZEROUNO on Mar 25, 2011 7:06 pm; edited 1 time in total |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1281
|
Posted: Mar 24, 2011 11:08 am Post subject: |
|
|
| Congratulations! |
|
| Back to top |
|
 |
|