Hi everyone,
Here's a newbie question for ya.
How can I limit the types of files a person can upload to my server? I only want the user to upload .gif, .jpg, or .bmp files.
here is the php i'm using:
if (is_uploaded_file($file_array['tmp_name'])) {
move_uploaded_file($file_array['tmp_name'],
"$file_dir/$rnd-$file_array[name]"
or die ("Couldnt copy"
;
print "file was moved!<br><br>";
}
}
works great but it allows any file to be uploaded. i have looked at PHP.net and searched through Tek-Tips. I am just missing what I need.
Can anyone point me in the right direction?
Thanks in advance..
Have A Great Day!!!,![[bigglasses] [bigglasses] [bigglasses]](/data/assets/smilies/bigglasses.gif)
Nathan
Software Testing Lead
Here's a newbie question for ya.
How can I limit the types of files a person can upload to my server? I only want the user to upload .gif, .jpg, or .bmp files.
here is the php i'm using:
if (is_uploaded_file($file_array['tmp_name'])) {
move_uploaded_file($file_array['tmp_name'],
"$file_dir/$rnd-$file_array[name]"
print "file was moved!<br><br>";
}
}
works great but it allows any file to be uploaded. i have looked at PHP.net and searched through Tek-Tips. I am just missing what I need.
Can anyone point me in the right direction?
Thanks in advance..
Have A Great Day!!!,
![[bigglasses] [bigglasses] [bigglasses]](/data/assets/smilies/bigglasses.gif)
Nathan
Software Testing Lead