XUpload - write comment onto a txt file after upload is done - Page 2

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

#16 Postby PilgrimX182 » Jun 06, 2007 8:46 am

Use this code instead:

Code: Select all

print FILE join(',', map{"'$cg->param($_)'"} qw(comment name emailaddress) );
- this will put fields in single quotes.

drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

#17 Postby drumcritic » Jun 06, 2007 2:08 pm

um, when i use the line above, I get this in my text file:

'CGI=HASH(0x932cbdc)->param(comment)','CGI=HASH(0x932cbdc)->param(description)','CGI=HASH(0x932cbdc)->param(email)'

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

#18 Postby PilgrimX182 » Jun 07, 2007 5:18 am

Oh, then this one.

Code: Select all

print FILE join(',', map{q{'}.$cg->param($_).q{'}} qw(comment name emailaddress) );

drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

#19 Postby drumcritic » Jun 09, 2007 2:09 pm

thanks a lot!
one more thing. When I try to upload 2 files of the same name, the second file name will change from "name" to "name2" which is fine. But the first text file that is created by "name" is overwritten by the text file created by "name2". is there any way that I can fix that?

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

#20 Postby PilgrimX182 » Jun 11, 2007 5:19 am

Replace your line in upload.cgi:

Code: Select all

open(FILE,">$c->{target_dir}/$fn.txt");
with

Code: Select all

open(FILE,">$c->{target_dir}/$fn$i.txt");

drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

#21 Postby drumcritic » Jun 11, 2007 1:45 pm

thank you sooo much!

viiksi
Posts: 2
Joined: Aug 19, 2010 5:27 pm

#22 Postby viiksi » Aug 19, 2010 5:36 pm

I would like to get this same thing working on my Xuploader PRO.

I tried to add some of those lines you posted here but every time it just breaks it ;)

Any way to put a bit more code visible so i see exactly where to put those lines.

Idea in this works perfectly for my purpose.