473,406 Members | 2,217 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,406 software developers and data experts.

Text file upload

I have a form with file input as follows.

<FORM Name="F1" enctype="multipart/form-data" Method="post" Action="sample.asp" target=Frm2>
Choose File <input type="file" name="file1" size="20">
</form>

When I click on Browse button, I would like to see only .txt files, i.e. in "Files of type" it needs to be .txt and not "All files".

How will I achieve this in ASP?

Thanks in advance.

Krithika
Jan 30 '08 #1
2 1475
CroCrew
564 Expert 512MB
Hello krithikav,

Sorry this is not possible with FileUpload control. What has always been suggested is to check the file extension before uploading file to the server.

Sorry, but that is the best that I have ever came up with~
Jan 30 '08 #2
jhardman
3,406 Expert 2GB
Hello krithikav,

Sorry this is not possible with FileUpload control. What has always been suggested is to check the file extension before uploading file to the server.

Sorry, but that is the best that I have ever came up with~
W3C says the "Accepts" attribute does this, but I was told most current browsers ignore this attribute. Syntax should be:
Expand|Select|Wrap|Line Numbers
  1. <input type="file" accepts="text/html">
Feb 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John | last post by:
I am using Excel to save a spreadsheet in .csv format. This creates a text file with extension .csv But when I try to upload the file to the server by checking for its MIME type using $_FILE I get...
1
by: Eric | last post by:
I have a form with an INPUT type=file in it. I have another button that calls a function to exercise the oHTTP below. I think I need to open with the path of the CGI script on the server. What...
6
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to...
1
by: Jeremy Chapman | last post by:
How can I display a file open dialog by clicking a button in an aspx page, have the user select a text file then display the contents into a control such as a text box
1
by: JenHu | last post by:
Hi experts, I want to create a new empty text file after I upload a file to the desination. Then I need to read each line from the uploaded file and write the lines which first character <>'6'...
1
by: Grzegorz ¦lusarek | last post by:
Hi All. One of the fields used in my form is to upload file, Is is to posible to made this field readonly and after filling radio field set this to use by javascript. I don't wanna give a User...
7
by: pbd22 | last post by:
Hi. Can somebody tell me how I would go about allowing the user to click on a link to put content in text box A and then another link to put different content in text box A and so on. Finally,...
0
by: divyagiridhar | last post by:
How do i specify the file type as text and excel when i want to upload a file using dotnet My code is as follows: <script language="C#" runat="Server"> //Event Handler for the upload button...
4
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.