I think I get what you mean. Mr. Flex, there are two ways to enable
filedownload from a server script in flex -
- Using a script which contains an html content in itself and thus the need
to do a navigatetourl so that it should be opened in different browser
window. In dotnet terminology an .aspx page or a php or jsp .This html page
will then open the file dialog asking the user to download the file.
- Using a script which returns a purely binary data or file content. In
dotnet terminology a .ashx page and in java a pure servlet. These scripts
dont need a navigatetourl call, since in this way we can directly open the
file browser dialog in flex. This appears to be more user friendly.

We have used the second approach quite frequently in our project and were
also stuck at how to restrict the user from  changing the file extension
since the file filter only says All files. Check attached snapshot. We could
not find one solution but those were flex 2 days. Is it still an issue in
Flex 3 /flash player 10?

You might as well go ahead and try override the class. I have some time on
had so we can collaborate. Send me a mail if interested.

Thanks,
Peeyush
peeyus...@gmail.com

On Tue, Feb 2, 2010 at 10:40 PM, Prabh <schwri...@yahoo.com> wrote:

>
>
> Hey thanks for the reply.
>
> The way I am doing it is a little different. Since we get the SAVE AS
> dialog box, the user can change the extension on the file and thats where we
> want to restrict it. In the FILE TYPE option. It should not say ALL FILES
> (*.*)
>
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Flex"
> <myflexdownlo...@...> wrote:
> >
> >
> >
> > It can be done, but it does not have much to do with flex. The server
> side that sends the file can decide what name to give the file. So in php it
> would be something like
> >
> > header('Content-Disposition: attachment; filename="export.csv"')
> >
> > When you do a navigateToUrl from Flex to the url for file download
> brokered by the type of code above, you will be prompted to download a file
> with name with export.csv...with your xml content. Very similar syntax in
> java and cold fusion.
> >
> > Web Manager
> > FlexDownloads.com
> >
> > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>,
> "Prabh" <schwrizer@> wrote:
> > >
> > > I have XML data that I wish to store on the clients machine as a CSV.
> > >
> > >
> > > So,
> > >
> > > 1. Is it possible to restrict the file extension to be only CSV when
> the client gets the Save As dialog box ?
> > >
> > > you can do it on file.browse(), but I am not uploading a file. I am
> downloading the data to the client machine.
> > >
> > >
> > >
> > > 2. If 1 cannot be done, is it possible to override the class to achieve
> the same ?
> > >
> > >
> > >
> > > Any help would be greatly appreciated. Thanks in advance
> > >
> > >
> > >
> > > Prabh
> > >
> >
>
>  
>

Reply via email to