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.
XUpload - Adding a direct download link to confirmation email messages
-
- Posts: 8
- Joined: Mar 23, 2011 7:20 pm
-
- Posts: 8
- Joined: Mar 23, 2011 7:20 pm
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?!admin wrote:We would never try to teach 6 y.o child programming.
You'd better hire programmer to do that.
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: Select all
# Directory for uploaded files
target_dir => '/web/htdocs/www.your-site-name.com/home/uploads/',
3. Open upload.cgi and find this code:
Code: Select all
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'};
Code: Select all
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'};
Code: Select all
my @file_fields = qw(file_name file_name_orig file_status file_size file_descr file_mime);
Code: Select all
my @file_fields = qw(file_link file_name file_name_orig file_status file_size file_descr file_mime);
4. Open confirm_email.html and add this code inside the file details table, where you want to see the download link:
Code: Select all
<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>
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.