further help

at http://oldlook.experts-exchange.com/Computers/Programming/Languages/Perl/Q_10219315.html

i load up a file from someones computer onto my server
in the "files of type" drop down menu in the file upload
box how can i make sure that only .txt extensions are searched for?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The dialog box is displayed by the browser when the user clikcs on the Browse button. Not all browsers behave in the same way in this case. Some older browsers do not even display the Browse button, forcing the user to enter the full path name of the file being uploaded.

I don't think you can control the options in the dialog box from a CGI script or using any HTML code.

One think you can do is read the file name first and check the extension if it is the wanted one and display an error page it its not.
paulwhelanAuthor Commented:
sounds good any idea how to incorporate it into the code in the other question?
$fileName = $myCGI->param('fileName');
if (!$fileName) {
    print $myCGI->p("Sorry, your submission didn't include an upload.");
} elsif ($fileName !~ m/\.txt$/i) {  # check the extension
    print $myCGI->p("Sorry, Only text files are accepted.");
} else {

# process the upload


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
paulwhelanAuthor Commented:
brilliant thanks
paulwhelanAuthor Commented:
it always thinks that its not a .txt file when
i have that as my first clause in checking the file.....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.