Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
File output
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bill  
View profile  
 More options Dec 11 2009, 9:10 am
From: bill <will...@techservsys.com>
Date: Fri, 11 Dec 2009 09:10:27 -0500
Local: Fri, Dec 11 2009 9:10 am
Subject: File output

I am a relative AJAX neophyte and a complete newbe to prototype.

I have an application that successively loads a series of php pages into
the same div without problem using Ajax.updater.
The last php script, instead of generating html, writes a file to the
output in OpenOffice Writer format (with the appropriate headers) so
instead of displaying the result I want it to do a file download.  
(http://www.phpclasses.org/browse/package/5797.html)

Now we get to the place I am lost.

I presume that instead of Ajax.updater I want to do something else  
(Ajax Request ?) but I am not sure how to do this.

--
Bill Drescher
william {at} TechServSys {dot} com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
speedpacket@gmail.com  
View profile  
 More options Dec 11 2009, 9:43 am
From: "speedpac...@gmail.com" <speedpac...@gmail.com>
Date: Fri, 11 Dec 2009 06:43:33 -0800 (PST)
Local: Fri, Dec 11 2009 9:43 am
Subject: Re: File output
I'm not sure if it's the right way to do, but I just do an http call
(just link to the url), and make sure that my PHP script returns the
appropiate headers for the browser to download the file rather than
open it inline...

I don't think you need ajax for this...

On Dec 11, 3:10 pm, bill <will...@techservsys.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Dec 11 2009, 9:49 am
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Fri, 11 Dec 2009 14:49:59 -0000
Local: Fri, Dec 11 2009 9:49 am
Subject: Re: [Proto-Scripty] Re: File output
Ajax cannot process a file download in the same way it cannot process a file
upload...

You have to output the link and make the user click it

Alex Mcauley
http://www.thevacancymarket.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Williams  
View profile  
 More options Dec 11 2009, 9:52 am
From: Brian Williams <brianw1...@gmail.com>
Date: Fri, 11 Dec 2009 09:52:23 -0500
Local: Fri, Dec 11 2009 9:52 am
Subject: Re: [Proto-Scripty] Re: File output

you would be exactly right.

and to protect from hot linking then check the http referrer or a session
variable and if that fails then redirect to a landing page.

you want to investigate the following header info

//cache controlling
header("Cache-Control: public");
//force download
header("Content-Description: File Transfer");
//set filename
header("Content-Disposition: attachment; filename=export.csv");

there are others of course

On Fri, Dec 11, 2009 at 9:43 AM, speedpac...@gmail.com <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Dec 11 2009, 10:08 am
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Fri, 11 Dec 2009 15:08:50 -0000
Local: Fri, Dec 11 2009 10:08 am
Subject: Re: [Proto-Scripty] Re: File output

I'm not often wrong but i am right this time !!!

Alex Mcauley
http://www.thevacancymarket.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
speedpacket@gmail.com  
View profile  
 More options Dec 11 2009, 10:35 am
From: "speedpac...@gmail.com" <speedpac...@gmail.com>
Date: Fri, 11 Dec 2009 07:35:35 -0800 (PST)
Local: Fri, Dec 11 2009 10:35 am
Subject: Re: File output
he replied to my mail :p  I guess we're all right this time - what a
wonderful world it is ;)

On Dec 11, 4:08 pm, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bill  
View profile  
 More options Dec 11 2009, 4:38 pm
From: bill <will...@techservsys.com>
Date: Fri, 11 Dec 2009 16:38:02 -0500
Local: Fri, Dec 11 2009 4:38 pm
Subject: Re: [Proto-Scripty] Re: File output

speedpac...@gmail.com wrote:
> he replied to my mail :p  I guess we're all right this time - what a
> wonderful world it is ;

I haven't replied at all, until now.
> On Dec 11, 4:08 pm, "Alex McAuley" <webmas...@thecarmarketplace.com>
> wrote:

>> I'm not often wrong but i am right this time !!!

I feel much better about not being able to do what I couldn't do.
I guess I will open the last script in a new window and go from there.
Thanks all.

Alex is always right, as far as I know.

--
Bill Drescher
william {at} TechServSys {dot} com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Dec 11 2009, 5:38 pm
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Fri, 11 Dec 2009 22:38:04 -0000
Local: Fri, Dec 11 2009 5:38 pm
Subject: Re: [Proto-Scripty] Re: File output

Not always m8 but thanks for the confidence!!!!!!!!!
Alex Mcauley
http://www.thevacancymarket.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
speedpacket@gmail.com  
View profile  
 More options Dec 12 2009, 5:00 am
From: "speedpac...@gmail.com" <speedpac...@gmail.com>
Date: Sat, 12 Dec 2009 02:00:42 -0800 (PST)
Local: Sat, Dec 12 2009 5:00 am
Subject: Re: File output
Hi,

No need to open a new window - if it starts downloading you'll be left
with an empty window ;)
Just do an HTTP call to the server and your original page will remain
in the window if you have the correct headers going out from your
PHP...

David

On Dec 11, 10:38 pm, bill <will...@techservsys.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bill  
View profile  
 More options Dec 12 2009, 5:59 am
From: bill <will...@techservsys.com>
Date: Sat, 12 Dec 2009 05:59:02 -0500
Local: Sat, Dec 12 2009 5:59 am
Subject: Re: [Proto-Scripty] Re: File output

speedpac...@gmail.com wrote:
> Hi,

> No need to open a new window - if it starts downloading you'll be left
> with an empty window ;)
> Just do an HTTP call to the server and your original page will remain
> in the window if you have the correct headers going out from your
> PHP...

Would you be so kind as to expand your suggestion, perhaps with a line
of code ?

> David

--
Bill Drescher
william {at} TechServSys {dot} com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bill  
View profile  
 More options Dec 12 2009, 3:50 pm
From: bill <will...@techservsys.com>
Date: Sat, 12 Dec 2009 15:50:49 -0500
Local: Sat, Dec 12 2009 3:50 pm
Subject: Re: [Proto-Scripty] Re: File output

speedpac...@gmail.com wrote:
> Hi,

> No need to open a new window - if it starts downloading you'll be left
> with an empty window ;)
> Just do an HTTP call to the server and your original page will remain
> in the window if you have the correct headers going out from your
> PHP...

Interestingly enough, when I do a window.open() and the script just does
a download, the window does not actually open, just the download
dialog.  No orphan window after that (in FireFox).

--
Bill Drescher
william {at} TechServSys {dot} com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »