Hi!
We had problems that, on certain server configurations (ex.: safe mode,
umask setting, etc), it is not possible for Tiki to create a new directory.
If Tiki is unable to create the directory, can we have a descriptive
error message?
"This feature (unzip on server) is not available with the current server
configuration (unable to create temporary directory)."
Thanks!!
M ;-)
nyloth@... wrote:
> Update of /cvsroot/tikiwiki/tiki/lib/filegals
> In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28852/lib/filegals
>
> Modified Files:
> filegallib.php
> Log Message:
> [FIX] filegals : Uploading a zip archive in order to extract all it's files was done in the 'temp/' directory. This was a problem when this directory wasn't completely empty (generated PDF, README or .htaccess files, ...) since those other files were uploaded in the file gallery too. Now, zip files are extracted to 'temp/TMP_FILENAME/' in order to avoid unwanted files
>
> Index: filegallib.php
> ===================================================================
> RCS file: /cvsroot/tikiwiki/tiki/lib/filegals/filegallib.php,v
> retrieving revision 1.57
> retrieving revision 1.58
> diff -u -d -r1.57 -r1.58
> --- filegallib.php 15 Dec 2006 21:57:54 -0000 1.57
> +++ filegallib.php 20 Jan 2007 01:22:48 -0000 1.58
> @@ -357,10 +357,13 @@
> global $fgal_podcast_dir;
> include_once ('lib/pclzip.lib.php');
> include_once ('lib/mime/mimelib.php');
> + $extract_dir = 'temp/'.basename($file).'/';
> + mkdir($extract_dir);
> $archive = new PclZip($file);
> - $archive->extract('temp');
> + $archive->extract($extract_dir);
> + unlink($file);
> $files = array();
> - $h = opendir("temp");
> + $h = opendir($extract_dir);
> $gal_info = $this->get_file_gallery_info($galleryId);
> if ($podCastGallery = $this->isPodCastGallery($galleryId, $gal_info)) {
> $savedir=$fgal_podcast_dir;
> @@ -369,7 +372,7 @@
> }
>
> while (($file = readdir($h)) !== false) {
> - if ($file != '.' && $file != '..' && is_file("temp/$file") && $file != 'license.txt') {
> + if ($file != '.' && $file != '..' && is_file($extract_dir.'/'.$file)) {
> $files[] = $file;
>
> // check filters
> @@ -385,7 +388,7 @@
> $upl = 0;
> }
>
> - $fp = fopen('temp/' . $file, "rb");
> + $fp = fopen($extract_dir.$file, "rb");
> $data = '';
> $fhash = '';
>
> @@ -420,15 +423,16 @@
> $data = '';
> }
>
> - $size = filesize('temp/' . $file);
> + $size = filesize($extract_dir.$file);
> $name = $file;
> - $type = tiki_get_mime('temp/' . $file);
> + $type = tiki_get_mime($extract_dir.$file);
> $fileId = $this->insert_file($galleryId, $name, $description, $name, $data, $size, $type, $user, $fhash);
> - unlink ('temp/' . $file);
> + unlink ($extract_dir.$file);
> }
> }
>
> closedir ($h);
> + rmdir($extract_dir);
> }
>
> // Added by LeChuck, May 2, 2003
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Tikiwiki-cvs mailing list
> Tikiwiki-cvs@...
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
>
--
M ;-)
//////////////////////////////////////////////////////////////////
/ /
/ Marc Laporte <|> http://marclaporte.com /
/ Avantech.net <|> http://avantech.net /
/ Tiki CMS/Groupware <|> http://tikiwiki.org/UserPagemarclaporte /
/ /
//////////////////////////////////////////////////////////////////
|