Hi!
I've tested xupload (Free version), and I'm really impressed!
I think I'll order the pro version, but I have one problem:
What I have to change in upload.cgi to rename _every_ file to a (really) unique id (for example: file.ext should be renamed to 2DQ4MHk8YVD28TX1)
XUpload - rename files to unique id
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
It's easy hack. In upload.cgi find
and add below it:
this will set filename as random string of 10 chars(alphanumeric,uppercase) with no extension.
Code: Select all
my ($fn,$ext) = ($1,$2);
Code: Select all
my @range = ('0'..'9','A'..'Z');
$fn = join '', map $range[rand($#range+1)], 1..10;
$ext='';
I purchased the pro version now, and I added the code below and it works fine!
Thanks for your help!
tommy
Code: Select all
my ($fn,$ext) = .........
Thanks for your help!
tommy
Can you clarify which part of this needs to be changed??
Code: Select all
my ($fn,$ext) = $filename=~/^(.+)\.(.+)$/;
$fn=$filename unless $filename=~/\./;
$fn = substr($fn,0,$c->{max_name_length});