If I am viewing the Download Count page (/download_count) and then I click Export for one of the files, I will be redirected to a page (such as: /download_count/20856/export) with options.

No matter what I choose - or if I leave it blank - and click "Export" I get a helpful Drupal message "blahblahblah.csv has been successfully exported." but .. no file. Where was it exported to? Is it maybe explained somewhere that I haven't seen?

Thanks!

Comments

WorldFallz’s picture

That depends on where your browser is setup to download files to. Did you search the hard drive?

Offlein’s picture

Haha, no no, it didn't download in the browser, unless you've found a way to download files to the user's hard drive without notifying the user at all.

It's a Drupal message, like a drupal_set_message() message. And no popup or download actually occurs.

WorldFallz’s picture

with firefox, the download can occur with a quick message in the status bar only (no popup)-- easily missed. Did you actually search the hard drive? I can't seem to reproduce this.

Offlein’s picture

Nope, not that. I just checked on a different server and, guess what, works okay. Your thing looks like it writes a file first and then opens/sends that? I think the file may not be successfully written on my production server's temp dir or something. Looking deeper.

Offlein’s picture

So the headers look very different on the two servers, which is to be expected, but I don't know if there's something clearly on the non-working one that's not getting set right. I'm running it by my server people (that is, Acquia) as well.

Here's what I get in terms of headers on my working server:

HTTP/1.1 200 OK
Date: Thu, 19 May 2011 19:44:41 GMT
Server: Apache/2.2.17 (Ubuntu)
X-Powered-By: PHP/5.3.5-1ubuntu7.2
Last-Modified: Thu, 19 May 2011 19:44:41 +0000
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
Etag: "1305834281"
Content-Disposition: attachment; filename="download_count_export_fullbroganmasterclass.mp3_2011-05-19.csv"
Content-Length: 94585
CacheControl: no-cache
Pragma: no-cache
Expires: -1
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: application/csv; charset=utf-8

And here on the non-working (our production) server:

HTTP/1.1 302 Found
Server: nginx
Content-Type: application/csv; charset=utf-8
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
Etag: "1305834311"
Content-Disposition: attachment; filename="download_count_export_fullbroganmasterclass.mp3_2011-05-19.csv"
CacheControl: no-cache
Pragma: no-cache
Expires: -1
Last-Modified: Thu, 19 May 2011 19:45:11 GMT
Location: [[SNIPPED]]
X-AH-Environment: prod
Content-Length: 94756
Date: Thu, 19 May 2011 19:45:12 GMT
X-Varnish: 1008017494
Age: 0
Via: 1.1 varnish
Connection: keep-alive
X-Cache: MISS
webkenny’s picture

Title: CSV file "has been successfully exported." but not really » Download Count does not work with mod_fcgid + php cgi in a standard configuration
Priority: Major » Normal

We have discovered the problem. The PHP flush() command does not work with mod_fcgid + PHP fcgi in the default configuration. The OutputBufferSize, as suggested by http://permalink.gmane.org/gmane.comp.web.fastcgi.fcgid.user/322, needs to be set to an appropriate number.

The choice is on the user to either change this setting if their hosting provider allows it (most do not) or Download Count should find a different method to deliver the file. Possibly writing the file to Drupal's temporary directory and then delivering it.

IMO, the latter is the more compatible option.

WorldFallz’s picture

Thanks webkenny for tracking down this issue. I lost quite a bite of time trying to replicate it and never did have any success.

And I agree with your 2nd option of saving a temp file. Not sure when i'll be able to carve out the time for a patch, but I'll update this issue with progress.

Spechal’s picture

+1

Fixed my issues by setting FcgidOutputBufferSize 0 and putting ob_flush() before flush() on Apache 2.2.22, mod_fcgid 2.3.7 and PHP 5.3.16

WorldFallz’s picture

Title: Download Count does not work with mod_fcgid + php cgi in a standard configuration » Download Count export does not work with mod_fcgid + php cgi in a standard configuration
Status: Active » Postponed

cleaning the issue queue. This will have to wait unless someone provides a patch.

WorldFallz’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

i would think this applies to both versions, and would be fixed for d7 then backported for d6.

WorldFallz’s picture

Status: Postponed » Closed (cannot reproduce)

doesn't look like any more info is forthcoming on this one. closed for lack of activity.