dokeos
[ class tree: dokeos ] [ index: dokeos ] [ all elements ]

Procedural File: dropbox_download.php

Source Location: /main/dropbox/dropbox_download.php



Page Details:



Tags:

filesource:  Source Code for this file


Includes:

include_once('dropbox_functions.inc.php') [line 41]
include_once('dropbox_config.inc.php') [line 38]
include_once(api_get_path(LIBRARY_PATH).'/document.lib.php') [line 47]
require("../inc/global.inc.php") [line 35]
require_once("dropbox_init.inc.php") [line 349]
Dropbox module for Claroline handles downloads of files. Direct downloading is prevented because of an .htaccess file in the dropbox directory. So everything goes through this script.

  1. Initialising vars
  2. Authorisation
  3. Sanity check of get data & file
  4. Send headers
  5. Send file

NOTE : When testing this with PHP4.0.4 on WinXP and Apache2 there were problems with downloading in IE6 After searching the only explanation I could find is a problem with the headers:

HEADERS SENT WITH PHP4.3: HTTP/1.1�200�OK(CR) (LF) Date:�Fri,�12�Sep�2003�19:07:33�GMT(CR) (LF) Server:�Apache/2.0.47�(Win32)�PHP/4.3.3(CR) (LF) X-Powered-By:�PHP/4.3.3(CR) (LF) Set-Cookie:�PHPSESSID=06880edcc8363be3f60929576fc1bc6e;�path=/(CR) (LF) Expires:�Thu,�19�Nov�1981�08:52:00�GMT(CR) (LF) Cache-Control:�public(CR) (LF) Pragma:�(CR) (LF) Content-Transfer-Encoding:�binary(CR) (LF) Content-Disposition:�attachment;�filename=SV-262E4.png(CR) (LF) Content-Length:�92178(CR) (LF) Connection:�close(CR) (LF) Content-Type:�application/octet-stream(CR) (LF) (CR) (LF)

HEADERS SENT WITH PHP4.0.4: HTTP/1.1�200�OK(CR) (LF) Date:�Fri,�12�Sep�2003�18:28:21�GMT(CR) (LF) Server:�Apache/2.0.47�(Win32)(CR) (LF) X-Powered-By:�PHP/4.0.4(CR) (LF) Expires:�Thu,�19�Nov�1981�08:52:00�GMT(CR) (LF) Cache-Control:�no-store,�no-cache,�must-revalidate,�post-check=0,�pre-check=0,�,�public(CR) (LF) Pragma:�no-cache,�(CR) (LF) Content-Disposition:�attachment;�filename=SV-262E4.png(CR) (LF) Content-Transfer-Encoding:�binary(CR) (LF) Set-Cookie:�PHPSESSID=0a5b1c1b9d5e3b474fef359ee55e82d0;�path=/(CR) (LF) Content-Length:�92178(CR) (LF) Connection:�close(CR) (LF) Content-Type:�application/octet-stream(CR) (LF) (CR) (LF)

As you can see the there is a difference in the Cache-Control directive. I suspect that this explains the problem. Also take a look at http://bugs.php.net/bug.php?id=16458.




Tags:

author:  Jan Bols <jan@ivpv.UGent.be>, main programmer
author:  Ren� Haentjens <rene.haentjens@UGent.be>, several contributions (see RH)
author:  Roan Embrechts, virtual course support
version:  1.21
copyright:  2004-2005
require_once("dropbox_class.inc.php") [line 44]
require_once(api_get_path(LIBRARY_PATH).'/document.lib.php') [line 390]
require_once("dropbox_class.inc.php") [line 350]
require_once(api_get_path(LIBRARY_PATH).'/document.lib.php') [line 153]






Documentation generated on Thu, 12 Jun 2008 13:21:12 -0500 by phpDocumentor 1.4.1