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...)
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...)