( ! ) Warning: session_start(): open(/var/lib/php/session/sess_mfmkhce88iv2rskv7glsmivrl4, O_RDWR) failed: No such file or directory (2) in /var/www/bitweaver/live/users/includes/bit_setup_inc.php on line 82
Call Stack
#TimeMemoryFunctionLocation
10.0001248648{main}( ).../index.php:0
20.0001250704require_once( '/var/www/bitweaver/live/kernel/includes/setup_inc.php' ).../index.php:7
30.07631929728BitSystem->scanPackages( ).../setup_inc.php:141
40.08522198016BitSystem->loadPackage( ).../BitSystem.php:1183
50.08522201048include_once( '/var/www/bitweaver/live/users/includes/bit_setup_inc.php' ).../BitSystem.php:1109
60.08672605320session_start ( ).../bit_setup_inc.php:82

( ! ) Warning: session_write_close(): open(/var/lib/php/session/sess_mfmkhce88iv2rskv7glsmivrl4, O_RDWR) failed: No such file or directory (2) in /var/www/bitweaver/live/kernel/includes/classes/BitSystem.php on line 580
Call Stack
#TimeMemoryFunctionLocation
10.0001248648{main}( ).../index.php:0
20.15173363688require( '/var/www/bitweaver/live/forums/includes/view_topic_inc.php' ).../index.php:11
30.29383584216BitSystem->display( ).../view_topic_inc.php:133
40.29473586424BitSystem->preDisplay( ).../BitSystem.php:505
50.30163601032session_write_close ( ).../BitSystem.php:580

( ! ) Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in /var/www/bitweaver/live/kernel/includes/classes/BitSystem.php on line 580
Call Stack
#TimeMemoryFunctionLocation
10.0001248648{main}( ).../index.php:0
20.15173363688require( '/var/www/bitweaver/live/forums/includes/view_topic_inc.php' ).../index.php:11
30.29383584216BitSystem->display( ).../view_topic_inc.php:133
40.29473586424BitSystem->preDisplay( ).../BitSystem.php:505
50.30163601032session_write_close ( ).../BitSystem.php:580
Show Thread: Incorrect mime_type stored in liberty_files - bitweaver
     

Incorrect mime_type stored in liberty_files

Chris
Joined: 18 Jul 2008

Incorrect mime_type stored in liberty_files

Posted:24 Jul 2008 (13:49 UTC)
When I download files such as PPT, XLS etc. they are all identified as application/msword for some reason. This is the value stored for mime_type in liberty_files.

If I look at the file details /treasury/file/<id> the ICON is correctly selected but next to Filename is (application/msword).

I've traunched through the code but it's really hard to tell where this is happening.

If I look at lookupMimeType this seems to work when passed an XLS or PPT extension and returns the correct mime_type - so I really don't know where this is happening.</id>
spiderr
Profile Picture
Joined: 08 Feb 2004

Re: Incorrect mime_type stored in liberty_files

Posted:24 Jul 2008 (14:51 UTC)
What is the link you are using to download the files? Is it a direct link to the .xls in the storage/ directory etc.? If so, it is likely that your webserver is "helping you out" here.
Chris
Joined: 18 Jul 2008

Re: Incorrect mime_type stored in liberty_files

Posted:24 Jul 2008 (16:45 UTC)
I think I found (part of the issue at least):

If I comment out the escapeshell arg bit (as below) the mime type is then correct based on extension, i.e. it doesn't do a 'file ....' on the file (which returns:
'Microsoft Office Application' or 'application/msword' if I use 'file -bi' for each of PPT, XLS and DOC!)

Hmmm... must be some system issue or magic going wrong...

kernel/BitSystem.php:

<?php
  
function verifyMimeType$pFile ) {
                
$mime NULL;
                if( 
file_exists$pFile ) ) {
                        if( 
function_exists'finfo_open' ) ) {
                                
$finfo finfo_openFILEINFO_MIME );
                                
$mime finfo_file$finfo$pFile );
                                
finfo_close$finfo );
                        } 
/*else {
                                if (functionEnabled ("escapeshellarg") && functionEnabled ("exec"))
                                        $mime = exec( trim( 'file -bi ' . escapeshellarg ( $pFile ) ) );
                        }*/
                        
if( empty( $mime ) ) {
                                
$mime $this->lookupMimeTypesubstr$pFilestrrpos$pFile'.' ) + ) );
                        }
                        if( 
$len strpos$mime';' ) || $len strpos$mime';' ) ) {
                                
$mime substr$mime0$len );
                        }
                }
                return 
$mime;
}
?>

Chris
Joined: 18 Jul 2008

Re: Incorrect mime_type stored in liberty_files

Posted:24 Jul 2008 (17:18 UTC)
OK - It looks like magic on my RH ES4 OS.

/usr/share/file/magic.* is returning the application/msword for file -bi

Is there some configuration option that I could use, like disabling 'escapeshellarg'? Not sure what else that would affect...

Thanks,
C.
Chris
Joined: 18 Jul 2008

Re: Incorrect mime_type stored in liberty_files

Posted:24 Jul 2008 (21:42 UTC)
Better solution in the end was to modify my magic (/usr/share/file/magic.mime):

0 string \376\067\0\043 application/msword
#0 string \320\317\021\340\241\261 application/msword
0 string \333\245-\0\0\0 application/msword

then recompile with: file -C

Problem went away then.... seems like it should affect quite a few people though.
Lester Caine
Joined: 24 Apr 2004

Re: Incorrect mime_type stored in liberty_files

Posted:25 Jul 2008 (03:43 UTC)
The widows copy of magic.mime is fun as well. The problem here IS the php end getting things wrong. And we have to hard code the location in windows to get it to work at all.
Stephan Borg
Joined: 15 Feb 2004

Re: Incorrect mime_type stored in liberty_files

Posted:01 Jul 2009 (10:34 UTC)
Was a fix ever found for this issue? I'm having the same problem. Commenting out the code works for me too, but not sure if thats the right thing to do.
Lester Caine
Joined: 24 Apr 2004

Re: Incorrect mime_type stored in liberty_files

Posted:01 Jul 2009 (19:56 UTC)
In theory the problem has been fixed in PHP5.3 - but since there is still a lot of libraries that still need to be updated - testing is still a major problem.
As long as on windows systems, the correct path to magic is set in config_inc.php - as pointed out in the installer - then windows works OK.
  Page 1 of 1  1 
Post
If you are already registered, please enter your login credentials.
Anonymous Post