469,138 Members | 1,266 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,138 developers. It's quick & easy.

HTML + <input type=file> constraint doesnt work

Hi
I'm trying to input image file using this synax.
<input type=file name="tx_file" accept="image/*"
class=boxText>
But when open file dialouge appears, it shows all the
file and user can select any file and i.e. i dont want.
Can any one suggest me?
Cheers,
Bhavin
Jul 19 '05 #1
4 6532
Gazing into my crystal ball I observed "Bhavin"
<an*******@discussions.microsoft.com> writing in news:06da01c39865$7392df70
$a*******@phx.gbl:
Hi
I'm trying to input image file using this synax.
<input type=file name="tx_file" accept="image/*" class=boxText>
But when open file dialouge appears, it shows all the
file and user can select any file and i.e. i dont want.
Can any one suggest me?
Cheers,
Bhavin


http://www.cs.tut.fi/~jkorpela/forms/file.html

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 19 '05 #2
> Hi
I'm trying to input image file using this synax.
<input type=file name="tx_file" accept="image/*"
class=boxText>
But when open file dialouge appears, it shows all the
file and user can select any file and i.e. i dont want.
Can any one suggest me?


Yes, use client-side JavaScript to make sure the value of the field has the
proper extension before they can submit.
Jul 19 '05 #3
"Bhavin" <an*******@discussions.microsoft.com> wrote:
Hi
I'm trying to input image file using this synax.
<input type=file name="tx_file" accept="image/*"
class=boxText>
But when open file dialouge appears, it shows all the
file and user can select any file and i.e. i dont want.
Can any one suggest me?


The "name" attribute of the <input type="file"...> is read-only. If
you could assign a value to it, then you could upload *any* file from
*any* client's computer without the user being aware of what was going
on.

You can check the value the user has given the attribute when the form
is submitted (or each time the value is changed, though that kind of
thing can get messy).

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Jul 19 '05 #4
Hi, Bhavin

http://www.pstruh.cz/util/upload/Upl...e-Notification.
ASP

(see client-side script)

Antonin

"Bhavin" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
Hi
I'm trying to input image file using this synax.
<input type=file name="tx_file" accept="image/*"
class=boxText>
But when open file dialouge appears, it shows all the
file and user can select any file and i.e. i dont want.
Can any one suggest me?
Cheers,
Bhavin

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Brian Henry | last post: by
6 posts views Thread by reiyel | last post: by
5 posts views Thread by magix | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.