Welcome Guest, Not a member yet? Register   Sign In
Multi Upload with CI & swfUpload
#14

[eluser]mmorgensen[/eluser]
Can you let us know what you mean by session problems?

Just adding the "PHPSESSID" to your SWFUploader does not really do anything, you need to build in logic on the backend to map that session id back to a known user....

for example...


Bob has the session of 123ABC
Bob uses SWFUpload to send a file, we include PHPSESSID=123ABC
SWFUpload posts the form and uploads the data, but because of the way flash handles the upload, the flash app part gets it's own session id of XYZ789.

When the form is submitted, the controller processing the form needs to pull the $_POST['PHPSESSID'] value of ABC123 and map it back to the user Bob. It can pretty much ignore the session id of XYZ789, as it's not needed.

How you get your application to map the session id back to Bob is the tricky part. Smile

For me, I don't actually use the session id; gave up on this. I assign each user a unique 64bit APIKey that they use for uploading. If this value matches, they are golden to upload files. However, if someone else gets a hold of a person's APIKey, then they can upload file to the users account. I give the users a way to change their API key at will too. Smile I'm dealing with a low security app, your mileage may vary depending on your requirements.
Code:
if( isset($_POST['APIKEY']) ){
     $getuser = "SELECT username, user_id, user_bucket, site_apikey
                 FROM ht_users
                 WHERE site_apikey = ? ";
     $query = $this->db->query($getuser, array($_POST['APIKEY']) );
     $userdata = $query->row_array();
}

Hope this helps


Messages In This Thread
Multi Upload with CI & swfUpload - by El Forum - 02-03-2008, 11:47 AM
Multi Upload with CI & swfUpload - by El Forum - 02-03-2008, 01:54 PM
Multi Upload with CI & swfUpload - by El Forum - 02-06-2008, 05:54 PM
Multi Upload with CI & swfUpload - by El Forum - 02-29-2008, 05:12 PM
Multi Upload with CI & swfUpload - by El Forum - 03-04-2008, 03:41 PM
Multi Upload with CI & swfUpload - by El Forum - 04-04-2008, 09:34 PM
Multi Upload with CI & swfUpload - by El Forum - 06-07-2008, 05:31 PM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 12:01 AM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 12:37 AM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 12:58 AM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 05:36 AM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 05:36 AM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 09:18 AM
Multi Upload with CI & swfUpload - by El Forum - 06-13-2008, 09:39 AM
Multi Upload with CI & swfUpload - by El Forum - 06-25-2008, 11:06 PM
Multi Upload with CI & swfUpload - by El Forum - 10-01-2008, 07:55 AM
Multi Upload with CI & swfUpload - by El Forum - 10-08-2008, 12:40 PM
Multi Upload with CI & swfUpload - by El Forum - 10-08-2008, 05:03 PM
Multi Upload with CI & swfUpload - by El Forum - 04-27-2009, 07:37 AM
Multi Upload with CI & swfUpload - by El Forum - 04-27-2009, 01:33 PM
Multi Upload with CI & swfUpload - by El Forum - 09-25-2012, 09:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB