Jump to content

PHP Sessions - setting sessions from Flash


mrman23

Recommended Posts

Hi,

 

I have a log in script and Flash upload system that work as expected in IE, but as soon as they are applied in Firefox/Safari nothing. I have read around and it seems that this is to do with the way F&S deal with Sessions:

 

http://www.avertlabs.com/research/bl...ation-puzzles/

 

Now whilst that site offers a solution I am unable to get it to work (probably missing something obvious!).

 

My setup works like this, someone logs in using sessions, they navigate around and have the ability to upload images, to give them a graphical representation of the upload I opted to use a Flash bar that when sent back to php uses the login session to call a name from MySQL to name the uploaded file. This works fine on its own (without renaming) and in IE (with renaming) but nowhere else.

 

Not sure if there is an obvious work-around or a quick fix way to make the session from login carry through to the upload php without striping the uploaded file from the system(?)

 

Thanks for any suggestions/solutions! :)

Link to comment
Share on other sites

Here's the basic upload php page, as above when I place the include login at the beginning of the code it works fine in IE but not in the other major browsers.

 

<?php 
    if (is_uploaded_file($_FILES['Filedata']['tmp_name']))     { 

        $uploadDirectory = "uploads/"; 

function findexts ($filename) 
{ 
$filename = strtolower($filename) ; 
$exts = split("[/\\.]", $filename) ; 
$n = count($exts)-1; 
$exts = $exts[$n]; 
return $exts; 
} 

$ext = findexts ($_FILES['Filedata']['name']) ; 

$name = "$username"; 

$newname = "$name".".".$ext; 

        $uploadFile = $uploadDirectory . basename($newname); 

        copy($_FILES['Filedata']['tmp_name'], $uploadFile); 
    } 
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.