You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nicole Luneburg <Ni...@lisasoft.com> on 2008/07/16 06:36:46 UTC

struts2 file (how to define files of type)

Hi all,

Got another prob that I've also been trying to fix for a while ...
I have a file upload tag like:

<s:file name="fileName" label="File" />

I want to be able to specify what types of files are shown in the File Upload dialogue's "Files of type" field.
Right now it just says "All Files". I want to limit this to say *.csv files.

I have tried adding this:

accept="application/csv"

also tried:

accept="csv"

but none of these appears to change anything at all.

What am I doing wrong?

Thanks!
Nicole

________________________________
The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

RE: struts2 file (how to define files of type)

Posted by Sangeetha Rajagopal <sa...@gmail.com>.
Hi Nicole,

I am also facing same issue,
Have you solved the problem. ?

Let me know.

Thanks,
SAngeetha Rajagopal

Nicole Luneburg wrote:
> 
> oh bummer that sucks :(
> I just read that comment from the link you sent me:
> 
> "Current browsers generally ignore the ACCEPT attribute."
> 
> Grrr
> 
> Thanks for showing me that, I won't give up just yet so fingers crossed!
> Maybe there's a workaround hehe!
> 
> Nicole
> 
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@wantii.com]
> Sent: Wednesday, 16 July 2008 2:49 PM
> To: Struts Users Mailing List
> Subject: Re: struts2 file (how to define files of type)
> 
> I could be wrong, but I don't think there is a reliable method to
> accomplish what you're looking for...
> 
> http://htmlhelp.com/reference/html40/forms/input.html#file
> 
> Although it looks like it's part of the spec, I think browsers ignore
> attempts at setting "accept"
> 
> 
> 
> On Wed, 2008-07-16 at 14:06 +0930, Nicole Luneburg wrote:
>> Hi all,
>>
>> Got another prob that I've also been trying to fix for a while ...
>> I have a file upload tag like:
>>
>> <s:file name="fileName" label="File" />
>>
>> I want to be able to specify what types of files are shown in the File
>> Upload dialogue's "Files of type" field.
>> Right now it just says "All Files". I want to limit this to say *.csv
>> files.
>>
>> I have tried adding this:
>>
>> accept="application/csv"
>>
>> also tried:
>>
>> accept="csv"
>>
>> but none of these appears to change anything at all.
>>
>> What am I doing wrong?
>>
>> Thanks!
>> Nicole
>>
>> ________________________________
>> The contents of this email are confidential and may be subject to legal
>> or professional privilege and copyright. No representation is made that
>> this email is free of viruses or other defects. If you have received this
>> communication in error, you may not copy or distribute any part of it or
>> otherwise disclose its contents to anyone. Please advise the sender of
>> your incorrect receipt of this correspondence.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> The contents of this email are confidential and may be subject to legal or
> professional privilege and copyright. No representation is made that this
> email is free of viruses or other defects. If you have received this
> communication in error, you may not copy or distribute any part of it or
> otherwise disclose its contents to anyone. Please advise the sender of
> your incorrect receipt of this correspondence.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts2-file-%28how-to-define-files-of-type%29-tp18480113p20367356.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: struts2 file (how to define files of type)

Posted by Nicole Luneburg <Ni...@lisasoft.com>.
oh bummer that sucks :(
I just read that comment from the link you sent me:

"Current browsers generally ignore the ACCEPT attribute."

Grrr

Thanks for showing me that, I won't give up just yet so fingers crossed!
Maybe there's a workaround hehe!

Nicole

-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com]
Sent: Wednesday, 16 July 2008 2:49 PM
To: Struts Users Mailing List
Subject: Re: struts2 file (how to define files of type)

I could be wrong, but I don't think there is a reliable method to
accomplish what you're looking for...

http://htmlhelp.com/reference/html40/forms/input.html#file

Although it looks like it's part of the spec, I think browsers ignore
attempts at setting "accept"



On Wed, 2008-07-16 at 14:06 +0930, Nicole Luneburg wrote:
> Hi all,
>
> Got another prob that I've also been trying to fix for a while ...
> I have a file upload tag like:
>
> <s:file name="fileName" label="File" />
>
> I want to be able to specify what types of files are shown in the File Upload dialogue's "Files of type" field.
> Right now it just says "All Files". I want to limit this to say *.csv files.
>
> I have tried adding this:
>
> accept="application/csv"
>
> also tried:
>
> accept="csv"
>
> but none of these appears to change anything at all.
>
> What am I doing wrong?
>
> Thanks!
> Nicole
>
> ________________________________
> The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts2 file (how to define files of type)

Posted by Wes Wannemacher <we...@wantii.com>.
I could be wrong, but I don't think there is a reliable method to
accomplish what you're looking for... 

http://htmlhelp.com/reference/html40/forms/input.html#file

Although it looks like it's part of the spec, I think browsers ignore
attempts at setting "accept"



On Wed, 2008-07-16 at 14:06 +0930, Nicole Luneburg wrote:
> Hi all,
> 
> Got another prob that I've also been trying to fix for a while ...
> I have a file upload tag like:
> 
> <s:file name="fileName" label="File" />
> 
> I want to be able to specify what types of files are shown in the File Upload dialogue's "Files of type" field.
> Right now it just says "All Files". I want to limit this to say *.csv files.
> 
> I have tried adding this:
> 
> accept="application/csv"
> 
> also tried:
> 
> accept="csv"
> 
> but none of these appears to change anything at all.
> 
> What am I doing wrong?
> 
> Thanks!
> Nicole
> 
> ________________________________
> The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org