Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 21 Aug 2008 14:17:47 +0000 (UTC),    group: microsoft.public.dotnet.framework.aspnet        back       


Re: FileUpload FileSpec   
Hello Juan,

> if (FileUpload1.HasFile)
> {
> string filename = FileUpload1.FileName;
> string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
> if (extension == ".pdf")
> {
> //your upload code...
> }
> }

Thanks Juan. I already have something like that on the server-side.

I was hoping however to present the user of my site with a slightly friendlier 
interface by masking out everything other than pdfs in the dialog itself.

Looking around the net it doesn't seem like it's possible though.

--
Rory
date: Thu, 21 Aug 2008 14:17:47 +0000 (UTC)   author:   Rory Becker am

Re: FileUpload FileSpec   
According to w3.org you could try the "accept" attribute :

http://www.w3.org/TR/html4/interact/forms.html#adef-accept

that said I'm not sure this is widely supported...

--
Patrice

"Rory Becker" <rorybecker@newsgroup.nospam> a écrit dans le message de 
groupe de discussion : 3af103471d42b8cad1b833c40b99@news.microsoft.com...
> Hello Juan,
>
>> if (FileUpload1.HasFile)
>> {
>> string filename = FileUpload1.FileName;
>> string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
>> if (extension == ".pdf")
>> {
>> //your upload code...
>> }
>> }
>
> Thanks Juan. I already have something like that on the server-side.
>
> I was hoping however to present the user of my site with a slightly 
> friendlier interface by masking out everything other than pdfs in the 
> dialog itself.
>
> Looking around the net it doesn't seem like it's possible though.
>
> --
> Rory
>
>
date: Thu, 21 Aug 2008 16:38:16 +0200   author:   Patrice http://www.chez.com/scribe/

Re: FileUpload FileSpec   
Hi Rory,

As Patrice said, the accept attribute is not widely supported in current 
browsers. You can refer to this article for some workarounds:
http://www.cs.tut.fi/~jkorpela/forms/file.html#filter

I have another suggestion for you, that is using Silverlight, which is a 
cross-browser plug-in. We can filter the file in this way:
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "Image 
Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*";

I suggest you to wait for the release of Silverlight 2. In the mean time 
you can learn Silverlight 2 Beta 2 first. 
To get started with Silverlight:
http://silverlight.net/GetStarted/

Please feel free to let me know if you have further questions. You can also 
ask questions in the Silverlight forum:
http://silverlight.net/forums/

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Date: Thu, 21 Aug 2008 14:17:47 +0000 (UTC)
| Message-ID: 
| From: Rory Becker <rorybecker@newsgroup.nospam>
| Subject: Re: FileUpload FileSpec
| References: 
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=iso-8859-1; format=flowed
| X-Newsreader: JetBrains Omea Pro 1098.1
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host86-143-211-151.range86-143.btcentralplus.com 
86.143.211.151
| Lines: 1         
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl 
microsoft.public.dotnet.framework.aspnet:74407
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| 
| Hello Juan,
| 
| > if (FileUpload1.HasFile)
| > {
| > string filename = FileUpload1.FileName;
| > string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
| > if (extension == ".pdf")
| > {
| > //your upload code...
| > }
| > }
| 
| Thanks Juan. I already have something like that on the server-side.
| 
| I was hoping however to present the user of my site with a slightly 
friendlier 
| interface by masking out everything other than pdfs in the dialog itself.
| 
| Looking around the net it doesn't seem like it's possible though.
| 
| --
| Rory

| 
|
date: Fri, 22 Aug 2008 06:00:57 GMT   author:   (Allen Chen [MSFT])

Re: FileUpload FileSpec   
Hi Rory,

Is this problem solved? Please feel free to let me know if you need further 
assistance.

Regards, 
Allen Chen
Microsoft Online Community Support


--------------------
| Date: Thu, 21 Aug 2008 14:17:47 +0000 (UTC)
| Message-ID: 
| From: Rory Becker <rorybecker@newsgroup.nospam>
| Subject: Re: FileUpload FileSpec
| References: 
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=iso-8859-1; format=flowed
| X-Newsreader: JetBrains Omea Pro 1098.1
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host86-143-211-151.range86-143.btcentralplus.com 
86.143.211.151
| Lines: 1         
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl 
microsoft.public.dotnet.framework.aspnet:74407
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| 
| Hello Juan,
| 
| > if (FileUpload1.HasFile)
| > {
| > string filename = FileUpload1.FileName;
| > string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
| > if (extension == ".pdf")
| > {
| > //your upload code...
| > }
| > }
| 
| Thanks Juan. I already have something like that on the server-side.
| 
| I was hoping however to present the user of my site with a slightly 
friendlier 
| interface by masking out everything other than pdfs in the dialog itself.
| 
| Looking around the net it doesn't seem like it's possible though.
| 
| --
| Rory

| 
|
date: Tue, 26 Aug 2008 01:27:58 GMT   author:   (Allen Chen [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us