[flexcoders] Re: Creating and downloading a file in client or alternatives

2008-05-02 Thread ilkka.kudjoi
Good morning,

thanks for your answers! Still I have to ask for more detailed 
instructions: How can I donwload the file in Flex client? Both 
Filereferencer.download and URLLoader.load require that 
URLRequest.url is set to an URL, how can I generate a proper 
URLRequest object in client or pass it from the server to the client?
The problem is not about the contents of the file to be downloaded, 
but how to make the file available. Please note that our client is 
using the server over FluorineFX.

BR Ilkka


--- In flexcoders@yahoogroups.com, zoltan [EMAIL PROTECTED] wrote:

 Hi,
  
 with any type of backend you can generate files on the fly, so they 
will not
 be saved in the server's filesystem and your client will still 
access it
 with Url/FileReference
  
 For example check out the Simply Compatible: Tab Delimited Format 
section
 here
 http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/
asp200309so
 _l.asp
  
 Zoli
  
   _  
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of ilkka.kudjoi
 Sent: Wednesday, April 30, 2008 11:09 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Creating and downloading a file in client or
 alternatives
 
 
 
 Hi,
 
 we do have a flex application running on a server using .NET C# 
over 
 FluorineFX. We need to export tables in Excel, so I suppose should 
 create text file containing a html table and set it's mime type to 
 Excel so that the file would open in Excel as default.
 
 Is there any means of creating the file in the client and letting 
the 
 user download the file as it was coming from the remote server? If 
it 
 would be possible to create the file in client, it would be 
 preferable due to performance issues. Note, that I do not wan't to 
 access user's file system directly, only provide the user a dialog 
 where he/she can choose, where to save the file.
 
 If this is not possible, what practice would you suggest to handle 
 the case in server? So far I've googled that it should be possible 
to 
 create a file on the server, send the URL to the client and then 
use 
 FileReferencer class to download the file, but I found this 
solution 
 unpreferrable, because the file needs to be accessed only once and 
 only by the current user - no-one else, so I found saving the file 
in 
 server's filesystem not a good choice.
 
 I really appreciate your advice,
 BR Ilkka





[flexcoders] Re: Creating and downloading a file in client or alternatives

2008-05-02 Thread ilkka.kudjoi
Hi again,

my apologies for recurrent posting, but as I myself understand the 
problem better now, I am specifying it in detail to make answering 
easier.

As a repetition: We are running a Flex client with FluorineFX 
remoting service on a server running .NET framework (C#). We want to 
export about 1000+ items at a time to Excel, of which only a smaller 
part is downloaded and displayed in the client. So, when the user 
want's to pushes the export button, I see these alternatives:

1.
* a remote call which fetches all items is made. The call follows 
this remoting manner
http://www.fluorinefx.com/docs/fluorine/remotinginternals.html,
i.e. FluorineFX takes care of processing HTTP requests and responses.
* Acquired data is processed in the client to html table or cvs, and 
an HTTP request containing the data is generated and used with 
Filereference.download(request:URLRequest)
* A aspx page on the server wraps the data into a HTTP response with 
correct mime types and user is prompted to choose destination for the 
file.

This approach has one great disadvantage: The data is sent three 
times between the client and the server! This is why it would be 
great if the file could be generated in the client alone.

2.
* a URL request is generated in the client and sent to the server 
with Filereference.download without using FluorineFX, so that 
generating custom response to the request in the server is possible.
Note: Normally FluorineFX generates the response, so generating 
response in remoting service causes exception.

This option might not be possible at all, as user has to be 
authenticated in order to use our remoting services, I suppose only 
FluorineFX can access our remoting services properly. 

3.
* Generate a temporary, random-name file for downloading, pass the 
file name to client and let the user download the file. Remove the 
file after download.

Disadvantage: File is saved on the server.



I hope you can help me better with this description. Please accept my 
apologies and advice me towards the best solution.

Cheers, Ilkka



--- In flexcoders@yahoogroups.com, ilkka.kudjoi [EMAIL PROTECTED] 
wrote:

 Good morning,
 
 thanks for your answers! Still I have to ask for more detailed 
 instructions: How can I donwload the file in Flex client? Both 
 Filereferencer.download and URLLoader.load require that 
 URLRequest.url is set to an URL, how can I generate a proper 
 URLRequest object in client or pass it from the server to the 
client?
 The problem is not about the contents of the file to be 
downloaded, 
 but how to make the file available. Please note that our client is 
 using the server over FluorineFX.
 
 BR Ilkka
 
 
 --- In flexcoders@yahoogroups.com, zoltan zoltan@ wrote:
 
  Hi,
   
  with any type of backend you can generate files on the fly, so 
they 
 will not
  be saved in the server's filesystem and your client will still 
 access it
  with Url/FileReference
   
  For example check out the Simply Compatible: Tab Delimited 
Format 
 section
  here
  http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/
 asp200309so
  _l.asp
   
  Zoli
   
_  
  
  From: flexcoders@yahoogroups.com 
 [mailto:[EMAIL PROTECTED] On
  Behalf Of ilkka.kudjoi
  Sent: Wednesday, April 30, 2008 11:09 AM
  To: flexcoders@yahoogroups.com
  Subject: [flexcoders] Creating and downloading a file in client 
or
  alternatives
  
  
  
  Hi,
  
  we do have a flex application running on a server using .NET C# 
 over 
  FluorineFX. We need to export tables in Excel, so I suppose 
should 
  create text file containing a html table and set it's mime type 
to 
  Excel so that the file would open in Excel as default.
  
  Is there any means of creating the file in the client and 
letting 
 the 
  user download the file as it was coming from the remote server? 
If 
 it 
  would be possible to create the file in client, it would be 
  preferable due to performance issues. Note, that I do not wan't 
to 
  access user's file system directly, only provide the user a 
dialog 
  where he/she can choose, where to save the file.
  
  If this is not possible, what practice would you suggest to 
handle 
  the case in server? So far I've googled that it should be 
possible 
 to 
  create a file on the server, send the URL to the client and then 
 use 
  FileReferencer class to download the file, but I found this 
 solution 
  unpreferrable, because the file needs to be accessed only once 
and 
  only by the current user - no-one else, so I found saving the 
file 
 in 
  server's filesystem not a good choice.
  
  I really appreciate your advice,
  BR Ilkka
 





[flexcoders] Re: Creating and downloading a file in client or alternatives

2008-04-30 Thread simonjpalmer
you can do this as a comma separated or tab separated stream of text
prepared on the client then sent to a very simple jsp page on the
server which bounces it back as a response with the file name and mime
type set correctly so the client gets a download file dialog from the
browser. We do this with Excel and Word files from our app and use a
single jsp page to do the bounce.  I don't see the advantage of using
HTML as a file format in this case.

hth Simon

--- In flexcoders@yahoogroups.com, ilkka.kudjoi [EMAIL PROTECTED]
wrote:

 Hi,
 
 we do have a flex application running on a server using .NET C# over 
 FluorineFX. We need to export tables in Excel, so I suppose should 
 create text file containing a html table and set it's mime type to 
 Excel so that the file would open in Excel as default.
 
 Is there any means of creating the file in the client and letting the 
 user download the file as it was coming from the remote server? If it 
 would be possible to create the file in client, it would be 
 preferable due to performance issues. Note, that I do not wan't to 
 access user's file system directly, only provide the user a dialog 
 where he/she can choose, where to save the file.
 
 If this is not possible, what practice would you suggest to handle 
 the case in server? So far I've googled that it should be possible to 
 create a file on the server, send the URL to the client and then use 
 FileReferencer class to download the file, but I found this solution 
 unpreferrable, because the file needs to be accessed only once and 
 only by the current user - no-one else, so I found saving the file in 
 server's filesystem not a good choice.
 
 I really appreciate your advice,
 BR Ilkka