Revision history for FilesActionHillar


Revision [18297]

Last edited on 2008-01-28 00:10:59 by JeroenJansen [Modified links pointing to docs server]

No Differences

Revision [6139]

Edited on 2005-02-18 11:23:17 by JeroenJansen [Modified links pointing to docs server]
Additions:
~~& I was experiencing the IE download bug in our educational wiki. Students were not able to download files using IE, there were no problems with using FireFox. Im not sure about other browsers. I guess it's an IE specific problem. Hillar's patch fixed this problem nicely, thanks dude ;) -- JeroenJansen
Deletions:
~~& I was experiencing the IE download bug in our educational wiki. Students were not able to download files using IE, only with FireFox. Hillar's patch fixed this problem, thanks dude ;) -- JeroenJansen


Revision [6084]

Edited on 2005-02-17 14:06:12 by JavaWoman [added comment - bug where?]
Additions:
~~~&**Only** with FireFox? What about other browsers? Mozilla, Opera, Amaya, Netscape, Lynx... I'm still not clear whether we're talking about a bug in IE or a bug in Wikka or both. --JavaWoman


Revision [6068]

Edited on 2005-02-17 11:26:17 by JeroenJansen [big up Hillar!]
Additions:
~~& I was experiencing the IE download bug in our educational wiki. Students were not able to download files using IE, only with FireFox. Hillar's patch fixed this problem, thanks dude ;) -- JeroenJansen


Revision [6062]

Edited on 2005-02-16 22:39:04 by JavaWoman [added request for clarification]
Additions:
Pragma: no-cache Cache-control: no-cache,max-age=0,must-revalidate
~&What are you suggesting here Hillar? That IE has a bug or that Wikka has a bug? Or both? What is your solution (and will it work with **all** browsers)? --JavaWoman
Deletions:
Pragma: no-cache Cache-control: no-cache,max-age=0,must-revalidate


Revision [6006]

Edited on 2005-02-15 16:18:11 by HillarAarelaid [added request for clarification]
Additions:
====Modified File-Action====

http://support.microsoft.com/kb/316431
http://support.microsoft.com/kb/815313

When you attempt to open or download a Microsoft Office document (.doc file, .xls file, .ppt file, and so on) from a secure Web site in Internet Explorer, you may receive one of the following error messages, even though the document is available and downloaded from the server:
Internet Explorer cannot download file from server.

Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
-or-
The page cannot be displayed.

The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

Cannot find server or DNS Error
-or-
Office Application Name cannot open the file.

The problem occurs if the server is using Secure Sockets Layer (SSL) and has added one or both of the following HTTP headers to the response message:
Pragma: no-cache Cache-control: no-cache,max-age=0,must-revalidate
---------

%%(php)
<?php
// upload path
if ($this->config['upload_path'] == '')
$this->config['upload_path'] = 'files';
$upload_path = $this->config['upload_path'].'/'.$this->GetPageTag();
if (! is_dir($upload_path))
mkdir_r($upload_path);
// do the action
switch ($_REQUEST['action']) {
case 'download':
$_REQUEST['file'] = basename(urldecode($_REQUEST['file']));
if ($this->HasAccess('read')) {
$path = "{$upload_path}/{$_REQUEST['file']}";
$filename = basename($path);
// Examine Suffix
if (preg_match("/.*\.(\w+)$/i",$filename,$res))
$suffix=$res[1];
// Search MIME Type
if (!$suffix || $suffix=="" || !$this->config['mime_types']
|| !$mimes=implode("\n",file($this->config['mime_types'])))
$content_type="application/force-download";
else {
if (preg_match("/([A-Za-z.\/-]*).*$suffix/i",$mimes,$result))
$content_type=$result[1];
else
$content_type="application/force-download";
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");

Header("Content-Type: ".$content_type);

//Force the download
Header("Content-Disposition: attachment; filename=".$filename);
header("Content-Transfer-Encoding: binary");
Header("Content-Length: ".filesize($path));
// Header("Connection: close");
@readfile($path);
exit();
}
case 'delete':
if ($this->HasAccess('write')) {
// if ($this->IsAdmin()) {
@unlink("{$upload_path}/{$_REQUEST['file']}");
}
print $this->redirect($this->Href());
}
?>
%%

----
Deletions:
====Modified File-Action====

%%(php)
<?php
// upload path
if ($this->config['upload_path'] == '')
$this->config['upload_path'] = 'files';
$upload_path = $this->config['upload_path'].'/'.$this->GetPageTag();
if (! is_dir($upload_path))
mkdir_r($upload_path);
// do the action
switch ($_REQUEST['action']) {
case 'download':
$_REQUEST['file'] = basename(urldecode($_REQUEST['file']));
if ($this->HasAccess('read')) {
$path = "{$upload_path}/{$_REQUEST['file']}";
$filename = basename($path);
// Examine Suffix
if (preg_match("/.*\.(\w+)$/i",$filename,$res))
$suffix=$res[1];
// Search MIME Type
if (!$suffix || $suffix=="" || !$this->config['mime_types']
|| !$mimes=implode("\n",file($this->config['mime_types'])))
$content_type="application/force-download";
else {
if (preg_match("/([A-Za-z.\/-]*).*$suffix/i",$mimes,$result))
$content_type=$result[1];
else
$content_type="application/force-download";
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");

Header("Content-Type: ".$content_type);

//Force the download
Header("Content-Disposition: attachment; filename=".$filename);
header("Content-Transfer-Encoding: binary");
Header("Content-Length: ".filesize($path));
// Header("Connection: close");
@readfile($path);
exit();
}
case 'delete':
if ($this->HasAccess('write')) {
// if ($this->IsAdmin()) {
@unlink("{$upload_path}/{$_REQUEST['file']}");
}
print $this->redirect($this->Href());
}
?>
%%

----


Revision [5579]

Edited on 2005-02-04 14:36:22 by NilsLindenberg [cat. added]
Additions:
====Modified File-Action====
%%
----
CategoryUserContributions
Deletions:
%%


Revision [5575]

Edited on 2005-02-04 13:00:59 by HillarAarelaid [cat. added]
Additions:
%%(php)
%%
Deletions:


Revision [5574]

The oldest known version of this page was created on 2005-02-04 12:59:35 by HillarAarelaid [cat. added]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki