Limiting fileupload file types

I

ik

I'm using FP 2002 fileupload component to allow files to be uploaded to my
website. Currently site visitors can upload any type of file. I would like to
limit the type of files uploaded to say only pictures (*.jpg). Is there a way
to do this?
Thanks in advance for your response.
 
K

Kevin Spencer

I'm not sure how you'd do this with Frontpage, but I can tell you how it's
done on the client-side using JavaScript. You would want to write a
JavaScript function that checks the "value" attribute of the "input
type=file" form field. It would parse the file path, and starting from the
last "." check the file extension. If it wasn't the correct extension, it
would cause the form validation to return false, preventing the submit of
the form.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top