Forum Moderators: coopster
I really do not have a clear vision of the requirements map needed to script that task.
thank you
regards
Henry
1. member signs up
2. script creates a dir and subdir - naming convention? Does it match the username?
3. chmod the new dirs to be accessible by the script
4. have a script to read the dir and put links on screen to the contents
that work?
Do you have all the standard user management and login/auth stuff in there too?
are all of your uploads and dir management through scripts?
but I am not too sure about building number #4
yes all the user amangement and other stuffs are in place
It is part of a large system out of which one
a member upon payment get an automated creation of a full set of web pages created that are fully editable within my CMS
my script creates & shmod dir and sub dir named by taking username + # & characters rand
then it can be accessed through a "where ID= etc..."
that indeed is tied to my Auth sys.
I was not really happy in offering only a resize via my CMS, so I isolated the thumb maker and allow my clients to use it for any purpose
therefore a need to let them access Thumb_sub_dir content
also most do not know about win Zip so I need something more direct
thanks again
Thank you
yes this will be my new route
send an app d-load header
but I never had a need to built such a D-load app
is this one a good base to learn from and adapt to my needs
<<< (Credit goes to Zend)
<?
define('FILEDIR', '/mnt/dos/');
$path = FILEDIR . $file;
//check that this file exists and that it doesn't include
//any special characters
if(!is_file($path) OR!eregi('^[A-Z_0-9][A-Z_0-9.]*$', $file))
{
header("Location: error.php");
exit();
}
/*
** //check that the user has permission to download file
** if(user does not have permission)
** {
** //redirect to error page
** header("Location: error.php");
** exit();
** }
*/
$mimetype = array(
'doc'=>'application/msword',
'htm'=>'text/html',
'html'=>'text/html',
'jpg'=>'image/jpeg',
'pdf'=>'application/pdf',
'txt'=>'text/plain',
'xls'=>'application/vnd.ms-excel'
);
$p = explode('.', $file);
$pc = count($p);
//send headers
if(($pc > 1) AND isset($mimetype[$p[$pc - 1]]))
{
//display file inside browser
header("Content-type: " . $mimetype[$p[$pc - 1]] . "\n");
}
else
{
//force download dialog
header("Content-type: application/octet-stream\n");
header("Content-disposition: attachment; filename=\"$file\"\n");
}
header("Content-transfer-encoding: binary\n");
header("Content-length: " . filesize($path) . "\n");
//send file contents
$fp=fopen($path, "r");
fpassthru($fp);
?>