Input type = file - file extention problem

Hi,<br />
I'm using the following to browse(not upload just getting the link) through files: <br />
<br />
<form id="filesUploadForm" action="ConfigJsp-LanFile.jsp"><br />
<input type="file" name="file_Path" style="display:none;"> <br />
</form><br />
<br />
I would like the file extention allowed to be specific ones.<br />
<br />
I tried to add value="*.txt" but didn't change a thing.<br />
<br />
Please advise<br />
Thanks<!--content-->All I would like to know is if its possible to to enable the user to see specific file extensions after clicking the browse?<br />
Thanks<br />
<br />
<br />
<br />
Originally posted by garfild <br />
Hi,<br />
I'm using the following to browse(not upload just getting the link) through files: <br />
<br />
<form id="filesUploadForm" action="ConfigJsp-LanFile.jsp"><br />
<input type="file" name="file_Path" style="display:none;"> <br />
</form><br />
<br />
I would like the file extention allowed to be specific ones.<br />
<br />
I tried to add value="*.txt" but didn't change a thing.<br />
<br />
Please advise<br />
Thanks<!--content-->no and why are you hiding it?<br />
<br />
<input type="file" name="file_Path" style="display:none;"> <br />
<br />
why have that?<br />
<br />
the only way you can do what you want is to use serverside language, like you have to use it when they press submit so just add a check to it that will allow only a .txt extension.<!--content-->Hi,<br />
Thanks for the reply,<br />
I use the style="display:none because I don't want to upload a file I just want the path of the file as a string.<br />
I guess I will have to use a routine for enabeling certain extensions after all.<br />
bye<br />
<br />
<br />
<br />
Originally posted by scoutt <br />
no and why are you hiding it?<br />
<br />
<input type="file" name="file_Path" style="display:none;"> <br />
<br />
why have that?<br />
<br />
the only way you can do what you want is to use serverside language, like you have to use it when they press submit so just add a check to it that will allow only a .txt extension.<!--content-->you can't store a path in the file input box anyway, the user has to select the location.<!--content-->An even if there'd be a way to specify file extensions, it wouldn't be any safe way and you should still make the serverside check the extension.<!--content-->
 
Back
Top