Wednesday, 2 June 2010

Tip: File Upload Command

The problem:

This has occurred at several places I have worked.

You have a web form with a file upload control on it so users can add attachments.

If the user types a filename directly into the input box, it must be the full pathname and it must be typed exactly otherwise an error will occur when the form is submitted.

The file input button has confused some users who have never uploaded a file before, since the filename box appears first and looks like an area where the user should type something. Some users even try and copy and paste documents into the file path.

The solution:

You can prevent users from manually changing the file path on a file upload control by adding some JavaScript to the file upload control. This will force them to use the Browse button.

 

1 comments:

Martin Perrie said...

Hey, Ed! Nice to see you blogging. Look forward to reading some good tips here and meeting up in Belfast at ILUG.