ID:               37834
 Updated by:       [EMAIL PROTECTED]
 Reported By:      swcook at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Session related
 Operating System: Linux
 PHP Version:      4.4.2
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2006-06-17 22:28:42] SWCOOK at GMAIL dot COM

I don't think I made this clear enough, the script correctly names the
file when accessed via Internet Explorer.

------------------------------------------------------------------------

[2006-06-17 22:27:00] swcook at gmail dot com

Description:
------------
I understand that PHP is server-side and this should really not happen,
but I have a purely php page that cannot access the $_SESSION unless a
user is using Internet Explorer.  Moreover, Firefox and Opera cannot
access it.

Reproduce code:
---------------
<?php require_once('Connections/siteData.php'); ?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
?>
<?php
function storPath($fileType){
        if(stristr($fileType, ".avi") === TRUE || stristr($fileType, ".mov")
=== TRUE){
                return 'media';
        } else {
                return 'images';
        }       
}
$uploadFile =  $_SESSION['username']."_".
basename($_FILES['Filedata']['name'] );
$storage = storPath($uploadFile);
//path name of file for storage
$uploadFilePath = $storage."/".$uploadFile;
//if the file is moved successfully
if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] ,
$uploadFilePath ) ) {
        //populate session array to be passed to SQL
        $_SESSION['upFile'][] = $uploadFile;
        echo( '1 ' . $_FILES['Filedata']['name']);
//file failed to move
}else{
        echo( '0');
}
?>

Expected result:
----------------
If the uploaded file is named "james_2003.jpg" and
$_SESSION['username'] = "wilson" I expect the file to be saved on the
server as "wilson_james_2003.jpg". 

Actual result:
--------------
File is saved simply as "_james_2003.jpg".  It correct appends"_",
however, it doe not append $_SESSION['username'].


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37834&edit=1

Reply via email to