PDA

View Full Version : Help! File upload kills session?


Xabbu
05-25-2004, 01:34 PM
Howdy,

I'm having some problems with handling uploaded files. I don't want to use the database to store them.. the code below works for saving the files to the filesystem, so thats not my problem, however.. after handling the upload I seem to lose my session cookies (or however vB handles users) and it just pukes out the template minus any formatting (no css in the html source either) that is asking for a login.

Any ideas?



function upload() {

copy($_FILES['file']['tmp_name'], $_REQUEST['catdir'] . $_FILES['file']['name']);
unlink($_FILES['file']['tmp_name']);
chmod ($_REQUEST['catdir'] . $_FILES['file']['name'], 0666);

$navbits = array();
$navbits[$parent] = 'File Upload';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('vbd_file_upload') . '");');

}


...this is for a 'filebase' hack that I'm working on...

Edit: I should also add, the code above is being called from a function called 'upload' (I've changed the code above to reflect that...)

Xabbu
05-28-2004, 06:00 PM
Bump

Ok.. since this doesn't seem to be getting any answers, lets try this angle.. :)

How _should_ I handle file uploads in a script. Is there a tutorial out there for that? I did a search but didn't turn up anything helpful.