Download data from the form

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
cyppher.nl
Posts: 138
Joined: Wed 19. May 2004, 18:38
Location: Hilversum, Netherlands

Re: Download data from the form

Post by cyppher.nl »

Before IE7 even asks me what to do with it (open or save), I get the error-message.
I guess you talked about the "Open or Save" dialog window, but there's no solution...

I think act_export.php should output an HTML-table, as you said, but won't do it.
Any thoughts?
How do you do? And how do you do your wife?
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Re: Download data from the form

Post by Oliver Georgi »

If you get no Open/Save dialog while downloading you have to reset the behavior in IE (open Excel files in browser). Search the web how this can be done - or use another browser.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
User avatar
cyppher.nl
Posts: 138
Joined: Wed 19. May 2004, 18:38
Location: Hilversum, Netherlands

Re: Download data from the form

Post by cyppher.nl »

Oliver Georgi wrote:If you get no Open/Save dialog while downloading you have to reset the behavior in IE (open Excel files in browser). Search the web how this can be done - or use another browser.

Oliver
Oliver, thanks for your suggestion.
I tried to 'reset' download 'open/save' behaviour of IE7, found solutions on how-to, but doesn't solve the problem.
- or use another browser
I can't demand my clients to install another browser. It's simply not possible. Think of it, when your clients use a site in an intranet-environment on which workstations have no rights to install software, and the only browser is IE7, you can't just simply say: "Well, use another browser".

Again, how to fix this issue?
Has it got something to to with fileheaders or so? Should be easy to correct I guess?
Or what is the problem here? I don't ask you to fix it, but let me know what is cause of a browser trying to download a php-file instead of downloading the right document (MIME)?
How do you do? And how do you do your wife?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Download data from the form

Post by update »

There is some switch in conf.inc.php:
$phpwcms['inline_download'] = 0;
perhaps this one - just guessing... :|
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: Download data from the form

Post by Jensensen »

cyppher.nl wrote:...I tried to 'reset' download 'open/save' behaviour of IE7, found solutions on how-to, but doesn't solve the problem...
Where? What was it about?
Was this the right method?
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
cyppher.nl
Posts: 138
Joined: Wed 19. May 2004, 18:38
Location: Hilversum, Netherlands

Re: Download data from the form

Post by cyppher.nl »

Jensensen wrote:
cyppher.nl wrote:...I tried to 'reset' download 'open/save' behaviour of IE7, found solutions on how-to, but doesn't solve the problem...
Where? What was it about?
Was this the right method?
Yep, I tested it with another xls-service... it worked (got the open/save dialog!)

But again, don't you think the script should be fixed (as in the right output headers, mime-type, or whatever)?
Why would a valid formatted Excel-sheet not be able to be opened in the browser? Why must it be saved?
It's possible, for sure, but my knowledge doesn't reach far enough to fix it in this php-script (act_export.php)... :wink:
How do you do? And how do you do your wife?
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Re: Download data from the form

Post by Oliver Georgi »

real Exel file export necessary - I have one prepared for Microtrend which is working very well.

As workaround open act_export and delete or comment all lines containing headers - should look like this after all - first if() section only:

Code: Select all

	if (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
		// workaround for IE filename bug with multiple periods / multiple dots in filename
		// that adds square brackets to filename - eg. setup.abc.exe becomes setup[1].abc.exe
		$filename = preg_replace('/\./', '%2e', $filename, substr_count($filename, '.') - 1);
	}
	
	//header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
	//header('Last-Modified: '.gmdate('D, d M Y H:i:s GMT', time()) );
	//header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0');
	
	
	//header('Content-type: application/force-download'); 
 	//header('Content-Disposition: attachment; filename="'.$filename.'"');
	//header('Content-Transfer-Encoding: binary'.LF);
or try attached act_export.php

Oliver
Attachments
act_export.zip
(3.45 KiB) Downloaded 152 times
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
User avatar
cyppher.nl
Posts: 138
Joined: Wed 19. May 2004, 18:38
Location: Hilversum, Netherlands

Re: Download data from the form

Post by cyppher.nl »

Oliver Georgi wrote:real Exel file export necessary - I have one prepared for Microtrend which is working very well.

As workaround open act_export and delete or comment all lines containing headers - (...)
Oliver
Great, thanks!
This works fine here.

You know phpwcms very well :wink:
How do you do? And how do you do your wife?
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Re: Download data from the form

Post by Oliver Georgi »

cyppher.nl wrote: But again, don't you think the script should be fixed (as in the right output headers, mime-type, or whatever)?
Why would a valid formatted Excel-sheet not be able to be opened in the browser? Why must it be saved?
It's possible, for sure, but my knowledge doesn't reach far enough to fix it in this php-script (act_export.php)... :wink:
It's no real Excel file - just a html table...

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: Download data from the form

Post by juergen »

Oliver Georgi wrote:
It's no real Excel file - just a html table...
Hi Oliver

then the BLOB-Storage is only for security ? Hopefully beginning to understand ....
User avatar
Oliver Georgi
Site Admin
Posts: 9940
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Re: Download data from the form

Post by Oliver Georgi »

:? Which BLOB, you mean in database? There form data are stored in there and if someone asks for export it is rendered based on database.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
Post Reply