Forum Moderators: coopster & phranque

Message Too Old, No Replies

Submission

         

mofomikeman

12:18 am on Jan 31, 2005 (gmt 0)

10+ Year Member



I am a total newbie to Perl and Php. I have been doing html for about oh a month now. I need a script that can be used to upload only one type of file, being .swf. And I would like to understand how I can change the maximum file size, minimum file size, and other information.

Thanks,
Mike

mofomikeman

2:47 am on Jan 31, 2005 (gmt 0)

10+ Year Member



...

jatar_k

7:45 pm on Feb 1, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld mofomikeman,

do you have a prefernece between perl and php?

you could try a file uploader script from something like hotscripts and then just edit it. I have a sneaking suspicion you won't find one tailored specifically for swf.

rocknbil

6:50 pm on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can identify the uploaded extension

if ($file!~ /\.swf$/i) { &error("You're outta here!"); }

and file size is a function of the -s switch

$min = 100;
$max = 5000; # bytes
$fsize - -s $file;

if (($fsize > $min) && ($fsize < $max)) { &ok; }
else { &error("You're outta here!"); }