473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 6683
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Don | last post by:
Is there some way to populate the "Browse" box for a <input type=file...> with a default value? I can do it for <input type=text...>, but can't seem to do it for <input type=file...>. Any ideas?...
0
by: Reza | last post by:
Hello I have a html control, <input type= file ...> and 1. I want the user to select files always from a set location but not sure how or even is this possible 2. If it is possible, can it set...
1
by: myahact | last post by:
Hello, I have <input type=file id=myfile> in a form. In IE I can read the value thusly: document.getElementById("myfile").value But thusly returns "" in Mozilla/Netscape. I also tried...
1
by: Axe | last post by:
Here's the problem: I've got an ASP.NET (C#) web page that has a single <input type=file> control on it for uploading a file. The way the code works is that the uploaded file is then parsed for...
2
by: Evgeny Zoldin | last post by:
Hi ALL. I need to simulate send POST data ( - file upload) as it was submitted in Browser. In C# I create instanse of IE, navigate to page with the form, fill in the fields and try to Submit by...
10
by: Brian Henry | last post by:
Hi, I am having a problem with an attachment system I made... it works with files up to ~3MB in size then after that if you try to upload a file it just goes to a "Page can not be displayed" page...
6
by: reiyel | last post by:
hiya all i would like to ask some help for a little javascript, here's my problem: i have a html page with a <input type="file"> box, problem is i don't want the user to be able to write on the...
4
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
5
by: magix | last post by:
Hi, with: <Input type="file"...> it will let the user to click to "browse" button to browse for files, question is how can I limit the file type to be only jpg and gif extension, when the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.