Re: [flexcoders] Re: File download from server

2009-02-06 Thread Paul DSa
I had the same problem with my app. Once we shifted to flash player 10 my
downloads would keep giving the error.  I¹d generate a file on the user
click and then automatically start the download. From what I learnt it was a
security thing added in, to start the download event it requires user
interaction. I fixed it by added a message after the file gets created, once
the user selects ok, the download starts. Its not the prettiest solution,
but it works. 

-Paul


On 1/26/09 6:47 AM, Mika Kiljunen mkintens...@gmail.com wrote:

  
  
 
 Yep I have the same problem and get the same error. But funny enough, my app
 works perfectly with Flash Player 9, but fails with Flash Player 10 throwing
 Error: Error #2176: Certain actions, such as those that display a pop-up
 window, may only be invoked upon user interaction, for example by a mouse
 click or button press.
 
 -Mika
 
 
 
 On Wed, Jan 21, 2009 at 6:51 PM, valdhor valdhorli...@embarqmail.com wrote:
  
  
 
 Once you create the zip file you need to return the correct headers to
 the browser so that the browser will pop up the dialog box asking the
 user what to do.
 
 I don't use Java - I use PHP. When the user clicks a button in Flex I
 create a new URLRequest and then navigateToURL. The PHP script creates
 the file and when done sends the following headers:
 
 Header(Content-type: application/octet-stream);
 Header(Content-disposition: attachment; filename=zipTest.zip);
 
 The script then streams the file to the browser. The headers sent back
 to the browser cause the browser to pop up the save file window just
 as if the user clicked a file link on an HTML page.
 
 
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ,
 oneworld95 oneworl...@... wrote:
 
  I've run into an interesting situation with Flex: I've got a Java
  servlet that will generate a Zip file when the user clicks a button in
  Flex. But the file download dialog after the server action requires
  the user to click a button. It throws this error:
  
  Error: Error #2176: Certain actions, such as those that display a
  pop-up window, may only be invoked upon user interaction, for example
  by a mouse click or button press.
  
  So how do you handle these situations? After the server responds
  successfully, do you display a second button to do the actual Flex
  file download?
  
  - Alex
 
 
  
 
 
  
 




[flexcoders] Re: File download from server

2009-02-06 Thread oneworld95
Same solution: Ended up adding a button dynamically on the successful
response from the server that the file was ready. Then the user clicks
the just added [Download Zip] button to fetch the file.

- Alex C

--- In flexcoders@yahoogroups.com, Paul DSa dsapaul2...@... wrote:

 I had the same problem with my app. Once we shifted to flash player
10 my
 downloads would keep giving the error.  I¹d generate a file on the user
 click and then automatically start the download. From what I learnt
it was a
 security thing added in, to start the download event it requires user
 interaction. I fixed it by added a message after the file gets
created, once
 the user selects ok, the download starts. Its not the prettiest
solution,
 but it works. 
 
 -Paul
 
 
 On 1/26/09 6:47 AM, Mika Kiljunen mkintens...@... wrote:
 
   
   
  
  Yep I have the same problem and get the same error. But funny
enough, my app
  works perfectly with Flash Player 9, but fails with Flash Player
10 throwing
  Error: Error #2176: Certain actions, such as those that display a
pop-up
  window, may only be invoked upon user interaction, for example by
a mouse
  click or button press.
  
  -Mika
  
  
  
  On Wed, Jan 21, 2009 at 6:51 PM, valdhor valdhorli...@... wrote:
   
   
  
  Once you create the zip file you need to return the correct
headers to
  the browser so that the browser will pop up the dialog box asking the
  user what to do.
  
  I don't use Java - I use PHP. When the user clicks a button in Flex I
  create a new URLRequest and then navigateToURL. The PHP script
creates
  the file and when done sends the following headers:
  
  Header(Content-type: application/octet-stream);
  Header(Content-disposition: attachment; filename=zipTest.zip);
  
  The script then streams the file to the browser. The headers sent
back
  to the browser cause the browser to pop up the save file window just
  as if the user clicked a file link on an HTML page.
  
  
  
  --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com ,
  oneworld95 oneworld95@ wrote:
  
   I've run into an interesting situation with Flex: I've got a Java
   servlet that will generate a Zip file when the user clicks a
button in
   Flex. But the file download dialog after the server action
requires
   the user to click a button. It throws this error:
   
   Error: Error #2176: Certain actions, such as those that display a
   pop-up window, may only be invoked upon user interaction, for
example
   by a mouse click or button press.
   
   So how do you handle these situations? After the server responds
   successfully, do you display a second button to do the actual Flex
   file download?
   
   - Alex
  
  
   
  
  
   
 





Re: [flexcoders] Re: File download from server

2009-01-26 Thread Mika Kiljunen
Yep I have the same problem and get the same error. But funny enough, my app
works perfectly with Flash Player 9, but fails with Flash Player 10 throwing
Error: Error #2176: Certain actions, such as those that display a pop-up
window, may only be invoked upon user interaction, for example by a mouse
click or button press.

-Mika



On Wed, Jan 21, 2009 at 6:51 PM, valdhor valdhorli...@embarqmail.comwrote:

   Once you create the zip file you need to return the correct headers to
 the browser so that the browser will pop up the dialog box asking the
 user what to do.

 I don't use Java - I use PHP. When the user clicks a button in Flex I
 create a new URLRequest and then navigateToURL. The PHP script creates
 the file and when done sends the following headers:

 Header(Content-type: application/octet-stream);
 Header(Content-disposition: attachment; filename=zipTest.zip);

 The script then streams the file to the browser. The headers sent back
 to the browser cause the browser to pop up the save file window just
 as if the user clicked a file link on an HTML page.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 oneworld95 oneworl...@... wrote:
 
  I've run into an interesting situation with Flex: I've got a Java
  servlet that will generate a Zip file when the user clicks a button in
  Flex. But the file download dialog after the server action requires
  the user to click a button. It throws this error:
 
  Error: Error #2176: Certain actions, such as those that display a
  pop-up window, may only be invoked upon user interaction, for example
  by a mouse click or button press.
 
  So how do you handle these situations? After the server responds
  successfully, do you display a second button to do the actual Flex
  file download?
 
  - Alex
 

  



[flexcoders] Re: File download from server

2009-01-26 Thread oneworld95
For whatever reason, setting content-disposition stuff didn't work for
me and was running out of time. What I ended up doing was this,

 - User clicks a button to generate the file on the Java side and save
it to the server.
 - In Flex, when server returns the usual XML response saying all is
OK, I dynamically add a button to the app to handle the download using
a FileReference object. 
 - On successful download (Event.COMPLETE), I delete the button from
the app. 

- Alex

--- In flexcoders@yahoogroups.com, Mika Kiljunen mkintens...@... wrote:

 Yep I have the same problem and get the same error. But funny
enough, my app
 works perfectly with Flash Player 9, but fails with Flash Player 10
throwing
 Error: Error #2176: Certain actions, such as those that display a
pop-up
 window, may only be invoked upon user interaction, for example by a
mouse
 click or button press.
 
 -Mika
 
 
 
 On Wed, Jan 21, 2009 at 6:51 PM, valdhor valdhorli...@...wrote:
 
Once you create the zip file you need to return the correct
headers to
  the browser so that the browser will pop up the dialog box asking the
  user what to do.
 
  I don't use Java - I use PHP. When the user clicks a button in Flex I
  create a new URLRequest and then navigateToURL. The PHP script creates
  the file and when done sends the following headers:
 
  Header(Content-type: application/octet-stream);
  Header(Content-disposition: attachment; filename=zipTest.zip);
 
  The script then streams the file to the browser. The headers sent back
  to the browser cause the browser to pop up the save file window just
  as if the user clicked a file link on an HTML page.
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
  oneworld95 oneworld95@ wrote:
  
   I've run into an interesting situation with Flex: I've got a Java
   servlet that will generate a Zip file when the user clicks a
button in
   Flex. But the file download dialog after the server action requires
   the user to click a button. It throws this error:
  
   Error: Error #2176: Certain actions, such as those that display a
   pop-up window, may only be invoked upon user interaction, for
example
   by a mouse click or button press.
  
   So how do you handle these situations? After the server responds
   successfully, do you display a second button to do the actual Flex
   file download?
  
   - Alex
  
 
   
 





[flexcoders] Re: File download from server

2009-01-21 Thread valdhor
Once you create the zip file you need to return the correct headers to
the browser so that the browser will pop up the dialog box asking the
user what to do.

I don't use Java - I use PHP. When the user clicks a button in Flex I
create a new URLRequest and then navigateToURL. The PHP script creates
the file and when done sends the following headers:

Header(Content-type: application/octet-stream);
Header(Content-disposition: attachment; filename=zipTest.zip);

The script then streams the file to the browser. The headers sent back
to the browser cause the browser to pop up the save file window just
as if the user clicked a file link on an HTML page.





--- In flexcoders@yahoogroups.com, oneworld95 oneworl...@... wrote:

 I've run into an interesting situation with Flex: I've got a Java
 servlet that will generate a Zip file when the user clicks a button in
 Flex. But the file download dialog after the server action requires
 the user to click a button. It throws this error:
 
 Error: Error #2176: Certain actions, such as those that display a
 pop-up window, may only be invoked upon user interaction, for example
 by a mouse click or button press.
 
 So how do you handle these situations? After the server responds
 successfully, do you display a second button to do the actual Flex
 file download? 
 
 - Alex





[flexcoders] Re: File download:

2008-03-13 Thread shekharsinbox
Thanks... actually i want to klnow how to chage the type of the 
file..
*.ppt .jpeg etc by default downlaod window shows
filename: user given name
saves as type: ALlFiles(*.*)

I want save as fiel to be chaged the way we can change file name at 
runtime

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

 fr.download('your file url', 'your_variable this will bee the new 
 name on the file you downloade');
 
 
 --- In flexcoders@yahoogroups.com, shekharsinbox 
 shekharsinbox@ wrote:
 
  Hi , 
  
  I am using filerefrence.download() to download a file. 
  
  
  filereference.browse allows to filter the filetype by usinf 
  filefilter. 
  
  
  This is used with file upload to filter the file type. 
  
  
  * How can i filter the saveas file type in 
filerefrence.download. 
  
  
  BY default it is AllFiles(*.*). 
  I tried every futile chase says we dont have this functionality 
in 
  flex. 
  ANy light on this appriciated 
  Does any one knows .
 





[flexcoders] Re: File download:

2008-03-11 Thread Cato Paus
fr.download('your file url', 'your_variable this will bee the new 
name on the file you downloade');


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

 Hi , 
 
 I am using filerefrence.download() to download a file. 
 
 
 filereference.browse allows to filter the filetype by usinf 
 filefilter. 
 
 
 This is used with file upload to filter the file type. 
 
 
 * How can i filter the saveas file type in filerefrence.download. 
 
 
 BY default it is AllFiles(*.*). 
 I tried every futile chase says we dont have this functionality in 
 flex. 
 ANy light on this appriciated 
 Does any one knows .





[flexcoders] Re: File Download

2007-10-19 Thread Doug Lowder
One way to get the Open/Save dialog is to have your Flex control link 
to a server-side URL that sets the Content-Disposition header to 
something like attachment; filename=myFile.pdf.  You should also set 
the content type to the appropriate value based on the type of file 
ding downloaded.  How you set those headers depends on what server-side 
technology you're using - JSP, ASP, PHP, etc.  You can probably find 
some examples in the archives.

HTH,
Doug

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

 I want the user to be able to click on a link and download a file. 
 When they click on it, I want them to have to option to save the file
 or open it right there.
 
 I can use the file reference class so the users can click on the file
 and save it...but they have to navigate to that folder to open it. 
 Anyone know how to make the open dialog appear?
 
 Thanks,
 
 Nate





[flexcoders] Re: file download doesnt work?

2007-02-26 Thread TJ Downes
For anyone who may not have found the answer to this problem, I am
pretty certain this will solve your problems:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=3637d5c3


TJ



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

 I have the code below to download a file from my J2EE server but it
doesn't work. the dialog box to select the folder and file come up,
click OK and nothing happens.
 
 I see no log on the server side, meaning it is not calling my
servlet. Upload works.
 
 Any ideas?
 
 var params:URLVariables = new URLVariables();
 
 var req:URLRequest = new
URLRequest(http://localhost:7001/billing/servlet/FileSvlt;);
 
 req.method = URLRequestMethod.GET;
 
 req.data = new URLVariables(operation=DOWNLOADfileId=2);
 
 var fr:FileReference = new FileReference();
 
 fr.download( req, bla.txt );
 
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 -- 
 WARNING
 ---
 This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient.  No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message.  If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system.  The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful.  If you have received this e-mail
in error, please notify the sender.
 
 AVIS IMPORTANT
 --
 Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé.  L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation.  Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système.  La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux.  Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.





RE: [flexcoders] Re: file download doesnt work?

2006-12-13 Thread Dimitrios Gianninas
Close, now my servlet gets called, but the flash player never prompts me where 
to save my file, so in essence, nothing is downloaded.
 
Maybe my player is foubared!
 
Dimitrios Gianninas
RIA Developer
Optimal Payments Inc.
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
dubreeze2001
Sent: Tuesday, December 12, 2006 10:53 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: file download doesnt work?



Dimitrios,

This should work for you:
import flash.net.*;

var url:String;
url=http://localhost:7001/billing/servlet/FileSvlt?operation= 
http://localhost:7001/billing/servlet/FileSvlt?operation= ; 
url +=DOWNLOADfileId=2;

var urlRequest:URLRequest = new URLRequest(url);
sendToURL(urlRequest);

Tony D

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
Dimitrios Gianninas
[EMAIL PROTECTED] wrote:

 Yup tried that too :) I've tried GET, POST and using the servername,
localhost and my direct IP, no go.
 
 If I call my servlet directly in a browser, the download works like
a charm:

http://localhost:7001/billing/servlet/FileSvlt?operation=DOWNLOADfileID=5 
http://localhost:7001/billing/servlet/FileSvlt?operation=DOWNLOADfileID=5 
 
 I'm sure its something very very small.., any kind of debug I can
turn on?
 
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ]
On Behalf Of Brian Holmes
 Sent: Tuesday, December 12, 2006 4:34 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 
 Not Sure if this will work Dimitrios,
 But I seem to remember having similar issues and reading somewhere
that the constructor of the Url Request expected a url as a string.
 
 var req:URLRequest = new URLRequest(http://localhost
http://localhost/ : 7001/billing/ servlet/FileSvlt ) ;
 req.method = URLRequestMethod. GET;
 req.data = new URLVariables(operation=DOWNLOAD );
 try {
 var fr:FileReference = new FileReference( );
 fr.download( req );
 }
 catch( e:Error ) {
 trace( Download error:  + e.message );
 }
 
 
 
 I double checked some code of mine and that's exactly how i got it
working. Anyways, like I said, not sure if it will help,
 You probably have already tried it.
 
 Brian..
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ]
On Behalf Of Dimitrios Gianninas
 Sent: Tuesday, December 12, 2006 2:22 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 Yup tried that too... I'm perplexed!
 
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ]
On Behalf Of Valy Sivec
 Sent: Tuesday, December 12, 2006 10:26 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: Re: [flexcoders] file download doesnt work?
 
 
 
 How about changing reg.method=POST instead GET?.
 
 Valy
 
 
 
 
 - Original Message 
 From: Dimitrios Gianninas [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Sent: Tuesday, December 12, 2006 9:28:40 AM
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 
 Ok I switch the code around a bit and it looks more like this now:
 
 var req:URLRequest = new URLRequest() ;
 req.url = http://localhost: 7001/billing/ servlet/FileSvlt ;
 req.method = URLRequestMethod. GET;
 req.data = new URLVariables(operation=DOWNLOAD );
 try {
 var fr:FileReference = new FileReference( );
 fr.download( req );
 }
 catch( e:Error ) {
 trace( Download error:  + e.message );
 }
 
 
 But it still doesn't work, my Java servlet doesn't get called at
all. I have log messages in the service(), doGet() and doPost()
methods and I see nothing. My upload works like a charm.
 
 
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
 
 
 
 
 From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups.
com] On Behalf Of Dimitrios Gianninas
 Sent: Monday, December 11, 2006 3:15 PM
 To: [EMAIL PROTECTED] ups.com
 Subject: [flexcoders] file download doesnt work?
 
 
 
 I have the code below to download a file from my J2EE server but it
doesn't work. the dialog box to select the folder and file come up,
click OK and nothing happens.
 
 I see no log on the server side, meaning it is not calling my
servlet. Upload works.
 
 Any ideas?
 
 var params:URLVariables = new URLVariables( );
 
 var req:URLRequest = new URLRequest(http://localhost: 7001/billing/
servlet/FileSvlt );
 
 req.method

Re: [flexcoders] Re: file download doesnt work?

2006-12-13 Thread Valy Sivec
I looked over the code I have for the download. It seems weird that the 
FileReference class doesn't work as it should and probably somebody for Adobe 
can shed some light here.

Here is the code I have used:

   var request:URLRequest = new URLRequest(download.action);
  
request.method = URLRequestMethod.GET;  
  var 
params:URLVariables = new URLVariables(); 
  params.id = REPLACE_ME; 
  request.data = params;
  navigateToURL(request, _self);


HTH,
Valy





- Original Message 
From: Dimitrios Gianninas [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Wednesday, December 13, 2006 1:06:02 AM
Subject: RE: [flexcoders] Re: file download doesnt work?









  







Close, now my servlet gets called, but the flash player 
never prompts me where to save my file, so in essence, nothing is 
downloaded.

 

Maybe my player is foubared!

 

Dimitrios 
Gianninas

RIA 
Developer

Optimal 
Payments Inc.

 




From: [EMAIL PROTECTED] ups.com 
[mailto:flexcoders@ yahoogroups. com] On Behalf Of 
dubreeze2001
Sent: Tuesday, December 12, 2006 10:53 
PM
To: [EMAIL PROTECTED] ups.com
Subject: [flexcoders] Re: 
file download doesnt work?






Dimitrios,

This should work for you:
import flash.net.*;

var 
url:String;
url=http://localhost: 7001/billing/ servlet/FileSvlt ?operation=; 

url +=DOWNLOAD fileId=2 ;

var 
urlRequest:URLReque st = new 
URLRequest(url) ;
sendToURL(urlReques t);

Tony D

--- In 
[EMAIL PROTECTED] ups.com, 
Dimitrios Gianninas
dimitrios.giannina [EMAIL PROTECTED] 
wrote:

 Yup tried that too :) I've tried GET, POST and using the 
servername,
localhost and my direct IP, no go.
 
 If I call my 
servlet directly in a browser, the download works like
a charm:

http://localhost: 7001/billing/ servlet/FileSvlt ?operation= DOWNLOAD fileID=5
 

 I'm sure its something very very small.., any kind of debug I 
can
turn on?
 
 Dimitrios Gianninas
 RIA 
Developer
 Optimal Payments Inc.
 
 
 
 _ _ __
 
 From: [EMAIL PROTECTED] ups.com 
[mailto:[EMAIL PROTECTED] ups.com]
On 
Behalf Of Brian Holmes
 Sent: Tuesday, December 12, 2006 4:34 PM
 
To: [EMAIL PROTECTED] ups.com
 
Subject: RE: [flexcoders] file download doesnt work?
 
 
 

 Not Sure if this will work Dimitrios,
 But I seem to remember 
having similar issues and reading somewhere
that the constructor of the Url 
Request expected a url as a string.
 
 var req:URLRequest = new 
URLRequest(http://localhost
http://localhost/ : 7001/billing/ 
servlet/FileSvlt ) ;
 req.method = URLRequestMethod. GET;
 
req.data = new URLVariables( operation= DOWNLOAD );
 try 
{
 var fr:FileReference = new FileReference( );
 fr.download( req 
);
 }
 catch( e:Error ) {
 trace( Download error:  + 
e.message );
 }
 
 
 
 I double checked some 
code of mine and that's exactly how i got it
working. Anyways, like I said, 
not sure if it will help,
 You probably have already tried it.
 

 Brian..
 
 
 _ _ __
 
 From: [EMAIL PROTECTED] ups.com 
[mailto:[EMAIL PROTECTED] ups.com]
On 
Behalf Of Dimitrios Gianninas
 Sent: Tuesday, December 12, 2006 2:22 
PM
 To: [EMAIL PROTECTED] ups.com
 
Subject: RE: [flexcoders] file download doesnt work?
 
 
 
Yup tried that too... I'm perplexed!
 
 Dimitrios 
Gianninas
 RIA Developer
 Optimal Payments Inc.
 
 

  _ _ __
 
 From: 
[EMAIL PROTECTED] ups.com 
[mailto:[EMAIL PROTECTED] ups.com]
On 
Behalf Of Valy Sivec
 Sent: Tuesday, December 12, 2006 10:26 AM
 
To: [EMAIL PROTECTED] ups.com
 
Subject: Re: [flexcoders] file download doesnt work?
 
 
 

 How about changing reg.method= POST instead GET?.
 

 Valy
 
 
 
 
 - Original Message 

 From: Dimitrios Gianninas 
dimitrios.giannina [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] ups.com
 
Sent: Tuesday, December 12, 2006 9:28:40 AM
 Subject: RE: [flexcoders] 
file download doesnt work?
 
 
 
 Ok I switch the 
code around a bit and it looks more like this now:
 
 var 
req:URLRequest = new URLRequest() ;
 req.url = http://localhost: 7001/billing/ servlet/FileSvlt 
;
 req.method = URLRequestMethod. GET;
 req.data = new 
URLVariables( operation= DOWNLOAD );
 try {
 var 
fr:FileReference = new FileReference( );
 fr.download( req );
 
}
 catch( e:Error ) {
 trace( Download error:  + e.message 
);
 }
 
 
 But it still doesn't work, my Java 
servlet doesn't get called at
all. I have log messages in the service(), 
doGet() and doPost()
methods and I see nothing. My upload works like a 
charm.
 
 
 Dimitrios Gianninas
 RIA 
Developer
 Optimal Payments Inc.
 
 
 
 _ _ __
 
 From: 
[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups.
com] On Behalf 
Of Dimitrios Gianninas
 Sent: Monday, December 11, 2006 3:15 PM
 
To: [EMAIL PROTECTED] ups.com
 Subject: [flexcoders] file download 
doesnt work?
 
 
 
 I have the code below to 
download a file from my J2EE server but it
doesn't work. the dialog box to 
select the folder

RE: [flexcoders] Re: file download doesnt work?

2006-12-13 Thread leds usop
have you tried attaching event listeners to the open
and complete events of your urlloader instance then
tracing the MIME type of the downloaded data (for the
complete event)? This way youll see if a download
actually commences (on open) and if the downloaded
data is decoded properly (on  complete). It is
possible that the dataformat of the urlloader instance
data is not what you require. just a thought

--- Dimitrios Gianninas
[EMAIL PROTECTED] wrote:

 Close, now my servlet gets called, but the flash
 player never prompts me where to save my file, so in
 essence, nothing is downloaded.
  
 Maybe my player is foubared!
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: flexcoders@yahoogroups.com
 [mailto:[EMAIL PROTECTED] On Behalf Of
 dubreeze2001
 Sent: Tuesday, December 12, 2006 10:53 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: file download doesnt work?
 
 
 
 Dimitrios,
 
 This should work for you:
 import flash.net.*;
 
 var url:String;

url=http://localhost:7001/billing/servlet/FileSvlt?operation=

http://localhost:7001/billing/servlet/FileSvlt?operation=
 ; 
 url +=DOWNLOADfileId=2;
 
 var urlRequest:URLRequest = new URLRequest(url);
 sendToURL(urlRequest);
 
 Tony D
 
 --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com , Dimitrios
 Gianninas
 [EMAIL PROTECTED] wrote:
 
  Yup tried that too :) I've tried GET, POST and
 using the servername,
 localhost and my direct IP, no go.
  
  If I call my servlet directly in a browser, the
 download works like
 a charm:
 

http://localhost:7001/billing/servlet/FileSvlt?operation=DOWNLOADfileID=5

http://localhost:7001/billing/servlet/FileSvlt?operation=DOWNLOADfileID=5
 
  
  I'm sure its something very very small.., any kind
 of debug I can
 turn on?
  
  Dimitrios Gianninas
  RIA Developer
  Optimal Payments Inc.
  
  
  
  
  From: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com ]
 On Behalf Of Brian Holmes
  Sent: Tuesday, December 12, 2006 4:34 PM
  To: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
  Subject: RE: [flexcoders] file download doesnt
 work?
  
  
  
  Not Sure if this will work Dimitrios,
  But I seem to remember having similar issues and
 reading somewhere
 that the constructor of the Url Request expected a
 url as a string.
  
  var req:URLRequest = new
 URLRequest(http://localhost
 http://localhost/ : 7001/billing/ servlet/FileSvlt
 ) ;
  req.method = URLRequestMethod. GET;
  req.data = new URLVariables(operation=DOWNLOAD
 );
  try {
  var fr:FileReference = new FileReference( );
  fr.download( req );
  }
  catch( e:Error ) {
  trace( Download error:  + e.message );
  }
  
  
  
  I double checked some code of mine and that's
 exactly how i got it
 working. Anyways, like I said, not sure if it will
 help,
  You probably have already tried it.
  
  Brian..
  
  
  
  From: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com ]
 On Behalf Of Dimitrios Gianninas
  Sent: Tuesday, December 12, 2006 2:22 PM
  To: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
  Subject: RE: [flexcoders] file download doesnt
 work?
  
  
  Yup tried that too... I'm perplexed!
  
  Dimitrios Gianninas
  RIA Developer
  Optimal Payments Inc.
  
  
  
  
  From: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
 [mailto:flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com ]
 On Behalf Of Valy Sivec
  Sent: Tuesday, December 12, 2006 10:26 AM
  To: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
  Subject: Re: [flexcoders] file download doesnt
 work?
  
  
  
  How about changing reg.method=POST instead GET?.
  
  Valy
  
  
  
  
  - Original Message 
  From: Dimitrios Gianninas
 [EMAIL PROTECTED]
  To: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
  Sent: Tuesday, December 12, 2006 9:28:40 AM
  Subject: RE: [flexcoders] file download doesnt
 work?
  
  
  
  Ok I switch the code around a bit and it looks
 more like this now:
  
  var req:URLRequest = new URLRequest() ;
  req.url = http://localhost: 7001/billing/
 servlet/FileSvlt ;
  req.method = URLRequestMethod. GET;
  req.data = new URLVariables(operation=DOWNLOAD
 );
  try {
  var fr:FileReference = new FileReference( );
  fr.download( req );
  }
  catch( e:Error ) {
  trace( Download error:  + e.message );
  }
  
  
  But it still doesn't work, my Java servlet doesn't
 get called at
 all. I have log messages in the service(), doGet()
 and doPost()
 methods and I see nothing. My upload works like a
 charm.
  
  
  Dimitrios Gianninas
  RIA Developer
  Optimal Payments Inc.
  
  
  
  
  From: [EMAIL PROTECTED

[flexcoders] Re: file download doesnt work?

2006-12-12 Thread Doug Lowder
So does:

  req.url = http://localhost:7001/billing/servlet/FileSvlt;;

mean that your client and server are one and the same?  Does it work 
if you use a DNS name or IP instead of localhost?

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

 Yup tried that too... I'm perplexed!
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Valy Sivec
 Sent: Tuesday, December 12, 2006 10:26 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] file download doesnt work?
 
 
 
 How about changing reg.method=POST instead GET?.
 
 Valy
 
 
 
 
 - Original Message 
 From: Dimitrios Gianninas [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Tuesday, December 12, 2006 9:28:40 AM
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 
 Ok I switch the code around a bit and it looks more like this now:
  
 var req:URLRequest = new URLRequest() ;
 req.url = http://localhost: 7001/billing/ servlet/FileSvlt ;
 req.method = URLRequestMethod. GET;
 req.data = new URLVariables(operation=DOWNLOAD );
 try {
   var fr:FileReference = new FileReference( );
   fr.download( req );
 }
 catch( e:Error ) {
   trace( Download error:  + e.message );
 }
  
  
 But it still doesn't work, my Java servlet doesn't get called at 
all. I have log messages in the service(), doGet() and doPost() 
methods and I see nothing. My upload works like a charm.
  
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. 
com] On Behalf Of Dimitrios Gianninas
 Sent: Monday, December 11, 2006 3:15 PM
 To: [EMAIL PROTECTED] ups.com
 Subject: [flexcoders] file download doesnt work?
 
 
 
 I have the code below to download a file from my J2EE server but 
it doesn't work. the dialog box to select the folder and file come 
up, click OK and nothing happens.
 
 I see no log on the server side, meaning it is not calling my 
servlet. Upload works.
 
 Any ideas?
 
 var params:URLVariables = new URLVariables( );
 
 var req:URLRequest = new URLRequest(http://localhost: 
7001/billing/ servlet/FileSvlt );
 
 req.method = URLRequestMethod. GET;
 
 req.data = new URLVariables(operation=DOWNLOADfileId=2);
 
 var fr:FileReference = new FileReference( );
 
 fr.download( req, bla.txt );
 
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 AVIS IMPORTANT
 
 WARNING
 
 Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés 
destinés au seul usage du destinataire visé. L'expéditeur original 
ne renonce à aucun privilège ou à aucun autre droit si le présent 
message a été transmis involontairement ou s'il est retransmis sans 
son autorisation. Si vous n'êtes pas le destinataire visé du présent 
message ou si vous l'avez reçu par erreur, veuillez cesser 
immédiatement de le lire et le supprimer, ainsi que toutes ses 
pièces jointes, de votre système. La lecture, la distribution, la 
copie ou tout autre usage du présent message ou de ses pièces 
jointes par des personnes autres que le destinataire visé ne sont 
pas autorisés et pourraient être illégaux. Si vous avez reçu ce 
courrier électronique par erreur, veuillez en aviser l'expéditeur.
 
 This electronic message and its attachments may contain 
confidential, proprietary or legally privileged information, which 
is solely for the use of the intended recipient. No privilege or 
other rights are waived by any unintended transmission or 
unauthorized retransmission of this message. If you are not the 
intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete 
it and all attachments from your system. The reading, distribution, 
copying or other use of this message or its attachments by 
unintended recipients is unauthorized and may be unlawful. If you 
have received this e-mail in error, please notify the sender.
 
 
 
 
 
 Any questions? Get answers on any topic at Yahoo! Answers 
http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfc
wMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx . Try it 
now. 
 
  
 
 -- 
 WARNING
 ---
 This electronic message and its attachments may contain 
confidential, proprietary or legally privileged information, which 
is solely for the use of the intended recipient.  No privilege or 
other rights are waived by any unintended transmission or 
unauthorized retransmission of this message.  If you are not the 
intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete 
it and all attachments from your system.  The reading, distribution, 
copying or other use of this message or its attachments by 
unintended recipients is 

[flexcoders] Re: file download doesnt work?

2006-12-12 Thread dubreeze2001
Dimitrios,

This should work for you:
import flash.net.*;

var url:String;
url=http://localhost:7001/billing/servlet/FileSvlt?operation=;; 
url +=DOWNLOADfileId=2;

var urlRequest:URLRequest = new URLRequest(url);
sendToURL(urlRequest);

Tony D


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

 Yup tried that too :) I've tried GET, POST and using the servername,
localhost and my direct IP, no go.
  
 If I call my servlet directly in a browser, the download works like
a charm:

http://localhost:7001/billing/servlet/FileSvlt?operation=DOWNLOADfileID=5
  
 I'm sure its something very very small.., any kind of debug I can
turn on?
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Brian Holmes
 Sent: Tuesday, December 12, 2006 4:34 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 
 Not Sure if this will work Dimitrios,
  But I seem to  remember having similar issues and reading somewhere
that the constructor of the Url Request expected a url as a string.
  
 var req:URLRequest = new URLRequest(http://localhost
http://localhost/ : 7001/billing/ servlet/FileSvlt ) ;
 req.method = URLRequestMethod. GET;
 req.data = new URLVariables(operation=DOWNLOAD );
 try {
   var fr:FileReference = new FileReference( );
   fr.download( req );
 }
 catch( e:Error ) {
   trace( Download error:  + e.message );
 }
  
  
  
 I double checked some code of mine and that's exactly how i got it
working. Anyways, like I said, not sure if it will help,
 You probably have already tried it.
  
 Brian..
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Dimitrios Gianninas
 Sent: Tuesday, December 12, 2006 2:22 PM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 Yup tried that too... I'm perplexed!
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Valy Sivec
 Sent: Tuesday, December 12, 2006 10:26 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] file download doesnt work?
 
 
 
 How about changing reg.method=POST instead GET?.
 
 Valy
 
 
 
 
 - Original Message 
 From: Dimitrios Gianninas [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Tuesday, December 12, 2006 9:28:40 AM
 Subject: RE: [flexcoders] file download doesnt work?
 
 
 
 Ok I switch the code around a bit and it looks more like this now:
  
 var req:URLRequest = new URLRequest() ;
 req.url = http://localhost: 7001/billing/ servlet/FileSvlt ;
 req.method = URLRequestMethod. GET;
 req.data = new URLVariables(operation=DOWNLOAD );
 try {
   var fr:FileReference = new FileReference( );
   fr.download( req );
 }
 catch( e:Error ) {
   trace( Download error:  + e.message );
 }
  
  
 But it still doesn't work, my Java servlet doesn't get called at
all. I have log messages in the service(), doGet() and doPost()
methods and I see nothing. My upload works like a charm.
  
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups.
com] On Behalf Of Dimitrios Gianninas
 Sent: Monday, December 11, 2006 3:15 PM
 To: [EMAIL PROTECTED] ups.com
 Subject: [flexcoders] file download doesnt work?
 
 
 
 I have the code below to download a file from my J2EE server but it
doesn't work. the dialog box to select the folder and file come up,
click OK and nothing happens.
 
 I see no log on the server side, meaning it is not calling my
servlet. Upload works.
 
 Any ideas?
 
 var params:URLVariables = new URLVariables( );
 
 var req:URLRequest = new URLRequest(http://localhost: 7001/billing/
servlet/FileSvlt );
 
 req.method = URLRequestMethod. GET;
 
 req.data = new URLVariables(operation=DOWNLOADfileId=2);
 
 var fr:FileReference = new FileReference( );
 
 fr.download( req, bla.txt );
 
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 AVIS IMPORTANT
 
 WARNING
 
 Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé. L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation. Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système. La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux. Si