|
-
Jul 23rd, 2003, 02:48 PM
#1
Thread Starter
Stuck in the 80s
HTML: Input Files and Accept?
For an input type of file, how do you use the attribute? I know it accepts context types, but I'm not sure what I would put if I wanted only .gif and .jpg images to show up.
I also know that they can still get a different type of file in there, so I'll also check it on the server side, but I'd like to only have it initially show those two file types.
I tried searching the forum (but not the web much), and didn't find an answer.
-
Jul 23rd, 2003, 02:57 PM
#2
Thread Starter
Stuck in the 80s
I've tried:
Code:
<input type="file" name="f_1" accept="image/gif, image/jpg">
But it doesn't seem to work.
-
Jul 23rd, 2003, 03:14 PM
#3
Addicted Member
Originally posted by The Hobo
I've tried:
Code:
<input type="file" name="f_1" accept="image/gif, image/jpg">
But it doesn't seem to work.
It should work, that's the proper code.
BUT, this method is very unreliable, because it basically tells the browser that only those types are allowed, and that can be easily changed so that the browser allows all types.
If you are using IE, it might be like that, not too sure though.
Gary W Web Developer & Designer
Visual Basic 6
-
Jul 23rd, 2003, 03:42 PM
#4
Thread Starter
Stuck in the 80s
Originally posted by Gary W
It should work, that's the proper code.
BUT, this method is very unreliable, because it basically tells the browser that only those types are allowed, and that can be easily changed so that the browser allows all types.
If you are using IE, it might be like that, not too sure though.
Yeah, but I'm checking the file type server-side (PHP) anyways. I just wanted that there as a little added bonus or something. Just for looks, I suppose.
-
Jul 23rd, 2003, 03:45 PM
#5
Addicted Member
Yep I know you are using PHP as well to check the filetype, but I was just answering your question.
Gary W Web Developer & Designer
Visual Basic 6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|