Posted by frizzle on 04/15/06 00:40
Jerry Stuckle wrote:
> frizzle wrote:
> > I asked my webhost, but they told me uploading
> > a folder and having it running uploads etc. is not
> > possible on Linux by default. Folders should be
> > chmod 777 or chmod 755.
> >
> > Frizzle.
> >
>
> Yes and no. It depends on how they have their folders configured.
>
> However, obviously they have it configured so you can't do it. But you should
> still be able to create the folder in PHP from a web page (so it's running as
> the Apache user) and upload to it. The folder should then have the Apache user
> as the owner.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
AFAIK the script below should be able to create dirs then
but i get the following error:
Warning: mkdir(testdir): Permission denied in
/usr/local/psa/home/vhosts/host.com/httpdocs/test/mkdir.php on line 5
Warning: Cannot modify header information - headers already sent by
(output started at
/usr/local/psa/home/vhosts/host.com/httpdocs/test/mkdir.php:5) in
/usr/local/psa/home/vhosts/host.com/httpdocs/test/mkdir.php on line 6
Frizzle.
+++++++++++++++++++++++++++++++++++++++++++++++++++
<?php
if(isset( $_POST['dir'] ))
{
mkdir( $_POST['dir'], 0755 );
header('Location: '.$PHP_SELF);
};
?><form action="<?php echo $PHP_SELF; ?>" method="post"
name="mkdirtest" target="_top" id="mkdirtest">
<label for="dir">dir</label>
<input type="text" name="dir" id="dir"<?php echo isset( $_POST['dir']
) ? ' value="'.$_POST['dir'].'"' : '' ?>>
<label for="Submit"></label>
<input type="submit" name="Submit" value="mkdir!" id="Submit">
</form><?php
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." ) {
echo $file.'<br>';
};
};
closedir( $handle );
?>
Navigation:
[Reply to this message]
|