Check for valid file name before saving

M

mpfohl

My form copies a file from one locatin, prompts the user to create a
new name for the file, then saves the file to another location.

is there an easy way to ensure the user has entered a valid file name
(e.g. did not use '/' or "^" or anything like that) so the save does
not fail? OR, would it be easier to some how set up error handling so
that if the save fails for that reason, i can prompt the user to try
again.

How would i do either of these things?

Thanks,
 
A

Allen Browne

You must use error handling for this kind of operation, as there are just
too many things that could go wrong.

Even if the file name is valid, the path may not exist.
Even if the path exists, the disk may be read-only.
Even if the disk allows entries, the user may not have permissions.
Even if the user has permissions, the disk may be full.
etc.
etc.
 
Top