473,624 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Upload question

In my project I am uploading file, using HttpPostedFile in ASP.NET. In
my project I have to allow user to upload pdf, gif and jepg file only.
I know after uploading file I can check ContentType of file and give
user a massage. But I like to filter files when in File Browser. So
when user will click the Browse.. button only list of pdf, gif and
jepg files
will be showing up in the file browser. But I don't know how to do
that . Can anybody please help me?

Thanks.

Pamela.
Jul 19 '05 #1
1 2557
This is a browser issue, not an asp issue, or asp.net. (This group is for
asp.) If I remember right, older browser did allow you to specify filetypes
in the properties of the input, but I think that ability has been removed in
newer browsers. You can use client-side script to retreive the value of the
file input and check the ~extension~. Try posting in a client side group
like microsoft.publi c.scripting.jsc ript.

Ray at home
"Pamela Chatterjee" <pa************ **@yahoo.com> wrote in message
news:b3******** *************** **@posting.goog le.com...
In my project I am uploading file, using HttpPostedFile in ASP.NET. In
my project I have to allow user to upload pdf, gif and jepg file only.
I know after uploading file I can check ContentType of file and give
user a massage. But I like to filter files when in File Browser. So
when user will click the Browse.. button only list of pdf, gif and
jepg files
will be showing up in the file browser. But I don't know how to do
that . Can anybody please help me?

Thanks.

Pamela.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
710
by: Mosher | last post by:
Hi all, this might be more of an html question but I think it can be done in PHP, so I will ask here. I have an html form that allows for .pdf file uploads. This script will serve two functions 1) upload a .pdf file to a specific directory on the web server and 2) create an entry into the db that includes the name of the file just uploaded. I want to have another web page that will dynamically list all of the names of the files uploaded...
13
4296
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
6
4128
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page comes back with all the data intact, except for the upload object. The text box for "MyFile" (my example) is always cleared. Why is that and is there a way to stop that from happening? Thanks,
4
4469
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use one of my webform pages which includes a button that pops up a window where you can upload files, if you upload files in this popup window, it seems to somehow clear out all of the session variables and the users get logged out. However, if...
1
2715
by: joshbeall | last post by:
Hi All, If I drop a form onto my page that allows file uploads, I know well enough how to handle the file upload in the server side via PHP. However, I have a question: when my browser actually *sends* a binary file (e.g., an image), does it encode it somehow for the upload? Or does it simply send a raw bytestream? The reason I am asking is that I am in the process of transferring some
9
2408
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that when I give a path like @"C:\holdfiles\myfile.txt" it looks on the server C drive. How do I pull from the client? Do I need a different class and/or method? Filestream? -- Thanks,
7
3180
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file" name="file_1" size=46 /><input type=submit /> so, after adding a few files, the input fields look like this:
2
4253
by: will.smothers | last post by:
All, I have two Windows Server 2003 boxes running IIS 6.0 webservers that host our proxy pac file. These two servers are behind a network load- balancer and house our corporation's Proxy PAC file. I am working on developing an ASP-based file upload solution for our Proxy team so that when they make a change to the PAC file, they simply have to go to this upload site, browse for the new PAC file on their system and then upload it to the...
1
1886
by: lPrentice | last post by:
Hello, After all this time, Linux file permissions still confuse me at times. I have a Python web-based application with an file (images) upload module. The application is running on two remote servers and a local server on my development network. The upload module works just fine when I'm uploading to my remote servers. But when I try to upload to my development server, I get a permission error. What I don't understand is who is...
12
2479
by: GuangXiN | last post by:
I want the file upload element disappear, instead of it, I place a text box and a button with my own css defination. but it doesn't work on IE7. What should I do now? <form action="upload.php" method="POST" enctype="multipart/form-data"> <p> <span>Select photo:</span> <input type="file" name="photo" style="display:none;"> <input type="text" name="photoUrl" class="s1" /> <input type="button" class="s2"...
0
8238
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8174
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8336
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.