Can HMTLInputFile textfield be readonly?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi NG!

I have this problem:

On an .aspx page an HTMLInputFile control allows the user to upload a file
from the local harddrive to the webserver. However, when the user has browsed
to a valid file, it is possible for him to change the path in the textbox
AFTERWARDS, to something invalid.. Is there any way to set the textbox part
of the control to read-only, so that the only way to specify a file is by
using the 'browse' button?

Any other thoughts on how to solve the problem?

Thanks!

regards,

ML
 
Hi,

You can use the following code snippet to avoid the user
changing the path after browing for a file.

<INPUT type="file" id="hif" onkeydown="return false;">

HTH

Mona[Grapecity]
 
Back
Top