473,854 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Chmod

Hi,

I am at the base of an FTP thingy i'm building, and i noticed that
it would only work if i chmod the folder 777, i thought to remember
correctly that previously on another site chmod 744 was enough,
now it isn't.
Am i mistaking, and should it always be 777 ? And isn't a chmodded
777 folder much more vulnerable?

Frizzle.
Code sofar below:
+++++++++++++++ +++++++++++
<?php

require_once('. ./inc/globals.php');

if( isset( $_FILES['image'] ) ){

$ftp_conn = @ftp_connect( $default_ftp_se rver )or
die('<b>Error!</b>');
@ftp_login( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
die('<bError!</b>');

$uploaddir = '../items/';
$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );

if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile ) ){
echo "File is valid, and was successfully uploaded.";
} else {
echo "Possible file upload attack!";
};

ftp_close( $ftp_conn );

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multip art/form-data" name="images" target="_top" id="images"
class="form">
<input name="image" type="file" id="image">
<br>
<input type="submit" name="upload" id="upload" value="Upload">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javasc ript:history.go (-1) ">
</form><?php

if (is_dir($upload dir)) {
if ($dh = opendir($upload dir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '..' && $file !== '.') echo "filename: $file :
filetype: " . filetype($uploa ddir . $file) . "<br>\r\n";
}
closedir($dh);
}
};

?>
----------------------------------------------------

Apr 4 '06 #1
47 3357

Gary L. Burnore wrote:
On 4 Apr 2006 15:10:39 -0700, "frizzle" <ph********@gma il.com> wrote:
Hi,

I am at the base of an FTP thingy i'm building, and i noticed that
it would only work if i chmod the folder 777, i thought to remember
correctly that previously on another site chmod 744 was enough,
now it isn't.
Am i mistaking, and should it always be 777 ? And isn't a chmodded
777 folder much more vulnerable?

Most definitely more vulnerable.
You want 755, not 744. You need the x bit set. It should look like
this:

drwxr-xr-x ... ...
The x on a directory means search, not execute. If you can't search
the directory, you can't read the files in it.

If you want people to be able to find the files but not list the
directory when they're on the server, you can set the directory as 711
which would look like:

drwx--x--x ... ...
Frizzle.
Code sofar below:
++++++++++++++ ++++++++++++
<?php

require_once('. ./inc/globals.php');

if( isset( $_FILES['image'] ) ){

$ftp_conn = @ftp_connect( $default_ftp_se rver )or
die('<b>Error! </b>');
@ftp_login( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
die('<bError !</b>');

$uploaddir = '../items/';
$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );

if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile ) ){
echo "File is valid, and was successfully uploaded.";
} else {
echo "Possible file upload attack!";
};

ftp_close( $ftp_conn );

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multi part/form-data" name="images" target="_top" id="images"
class="form" >
<input name="image" type="file" id="image">
<br>
<input type="submit" name="upload" id="upload" value="Upload">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javas cript:history.g o(-1) ">
</form><?php

if (is_dir($upload dir)) {
if ($dh = opendir($upload dir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '..' && $file !== '.') echo "filename: $file:
filetype: " . filetype($uploa ddir . $file) . "<br>\r\n";
}
closedir($dh);
}
};

?>
----------------------------------------------------

--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
| ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
Official .sig, Accept no substitutes. | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
| 0 1 7 2 3 / ݳ 3 74 9 3 0 ۳
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
=============== =============== =============== =============== ===============


Hmm, i still get an error; i chmodded both the destination folder AND
the executing script-file 755.

Warning: move_uploaded_f ile(../items/bg.jpg): failed to open stream:
Permission denied in
/home/httpd/vhosts/domain.com/httpdocs/new/admin/ftptest.php on line 15

Read mode Write mode Execute/search mode
Owner + + +
Group + - +
Others + - +

Frizzle.

Apr 4 '06 #2
Are you allowing your web server write permissions to the folder?
Assuming the webserver runs as 'nobody' .
755 with ownership nobody, nobody . Otherwise you'll need
775 with ownership frizzle, nobody
frizzle wrote:
Gary L. Burnore wrote:
On 4 Apr 2006 15:10:39 -0700, "frizzle" <ph********@gma il.com> wrote:
Hi,

I am at the base of an FTP thingy i'm building, and i noticed that
it would only work if i chmod the folder 777, i thought to remember
correctly that previously on another site chmod 744 was enough,
now it isn't.
Am i mistaking, and should it always be 777 ? And isn't a chmodded
777 folder much more vulnerable?

Most definitely more vulnerable.
You want 755, not 744. You need the x bit set. It should look like
this:

drwxr-xr-x ... ...
The x on a directory means search, not execute. If you can't search
the directory, you can't read the files in it.

If you want people to be able to find the files but not list the
directory when they're on the server, you can set the directory as 711
which would look like:

drwx--x--x ... ...
Frizzle.
Code sofar below:
++++++++++++++ ++++++++++++
<?php

require_once('. ./inc/globals.php');

if( isset( $_FILES['image'] ) ){

$ftp_conn = @ftp_connect( $default_ftp_se rver )or
die('<b>Error! </b>');
@ftp_login( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
die('<bError !</b>');

$uploaddir = '../items/';
$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );

if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile ) ){
echo "File is valid, and was successfully uploaded.";
} else {
echo "Possible file upload attack!";
};

ftp_close( $ftp_conn );

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multi part/form-data" name="images" target="_top" id="images"
class="form" >
<input name="image" type="file" id="image">
<br>
<input type="submit" name="upload" id="upload" value="Upload">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javas cript:history.g o(-1) ">
</form><?php

if (is_dir($upload dir)) {
if ($dh = opendir($upload dir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '..' && $file !== '.') echo "filename: $file :
filetype: " . filetype($uploa ddir . $file) . "<br>\r\n";
}
closedir($dh);
}
};

?>
----------------------------------------------------

--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
| ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
Official .sig, Accept no substitutes. | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
| 0 1 7 2 3 / ݳ 37 4 9 3 0 ۳
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
=============== =============== =============== =============== ===============


Hmm, i still get an error; i chmodded both the destination folder AND
the executing script-file 755.

Warning: move_uploaded_f ile(../items/bg.jpg): failed to open stream:
Permission denied in
/home/httpd/vhosts/domain.com/httpdocs/new/admin/ftptest.php on line 15

Read mode Write mode Execute/search mode
Owner + + +
Group + - +
Others + - +

Frizzle.


Apr 5 '06 #3

bobzimuta wrote:
Are you allowing your web server write permissions to the folder?
Assuming the webserver runs as 'nobody' .
755 with ownership nobody, nobody . Otherwise you'll need
775 with ownership frizzle, nobody
frizzle wrote:
Gary L. Burnore wrote:
On 4 Apr 2006 15:10:39 -0700, "frizzle" <ph********@gma il.com> wrote:

>Hi,
>
>I am at the base of an FTP thingy i'm building, and i noticed that
>it would only work if i chmod the folder 777, i thought to remember
>correctly that previously on another site chmod 744 was enough,
>now it isn't.
>Am i mistaking, and should it always be 777 ? And isn't a chmodded
>777 folder much more vulnerable?
Most definitely more vulnerable.
You want 755, not 744. You need the x bit set. It should look like
this:

drwxr-xr-x ... ...
The x on a directory means search, not execute. If you can't search
the directory, you can't read the files in it.

If you want people to be able to find the files but not list the
directory when they're on the server, you can set the directory as 711
which would look like:

drwx--x--x ... ...

>Frizzle.
>
>
>Code sofar below:
>
>
>++++++++++++++ ++++++++++++
><?php
>
> require_once('. ./inc/globals.php');
>
> if( isset( $_FILES['image'] ) ){
>
>$ftp_conn = @ftp_connect( $default_ftp_se rver )or
>die('<b>Error! </b>');
>@ftp_login( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
>die('<bError !</b>');
>
>$uploaddir = '../items/';
>$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );
>
>if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile )){
> echo "File is valid, and was successfully uploaded.";
>} else {
> echo "Possible file upload attack!";
>};
>
>ftp_close( $ftp_conn );
>
>};
>
>?>
><form action="<?php echo $PHP_SELF; ?>" method="post"
>enctype="multi part/form-data" name="images" target="_top" id="images"
>class="form" >
> <input name="image" type="file" id="image">
> <br>
> <input type="submit" name="upload" id="upload" value="Upload">
> <input name="cancel" type="button" id="cancel" value="Cancel"
>onClick="javas cript:history.g o(-1) ">
></form><?php
>
> if (is_dir($upload dir)) {
> if ($dh = opendir($upload dir)) {
> while (($file = readdir($dh)) !== false) {
> if ($file !== '..' && $file !== '.') echo "filename: $file :
>filetype: " . filetype($uploa ddir . $file) . "<br>\r\n";
> }
> closedir($dh);
> }
> };
>
>?>
>----------------------------------------------------
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
| ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
Official .sig, Accept no substitutes. | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
| 0 1 7 2 3 / ݳ3 7 4 9 3 0 ۳
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
=============== =============== =============== =============== ===============


Hmm, i still get an error; i chmodded both the destination folder AND
the executing script-file 755.

Warning: move_uploaded_f ile(../items/bg.jpg): failed to open stream:
Permission denied in
/home/httpd/vhosts/domain.com/httpdocs/new/admin/ftptest.php on line 15

Read mode Write mode Execute/search mode
Owner + + +
Group + - +
Others + - +

Frizzle.


Standard (DW created files/dirs) have user 'domainname', permissions
'rwx r-x r-x ',
Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
--- --- '

Frizzle.

Apr 5 '06 #4

frizzle wrote:
bobzimuta wrote:
Are you allowing your web server write permissions to the folder?
Assuming the webserver runs as 'nobody' .
755 with ownership nobody, nobody . Otherwise you'll need
775 with ownership frizzle, nobody
frizzle wrote:
Gary L. Burnore wrote:
> On 4 Apr 2006 15:10:39 -0700, "frizzle" <ph********@gma il.com> wrote:
>
> >Hi,
> >
> >I am at the base of an FTP thingy i'm building, and i noticed that
> >it would only work if i chmod the folder 777, i thought to remember
> >correctly that previously on another site chmod 744 was enough,
> >now it isn't.
> >Am i mistaking, and should it always be 777 ? And isn't a chmodded
> >777 folder much more vulnerable?
>
>
> Most definitely more vulnerable.
>
>
> You want 755, not 744. You need the x bit set. It should look like
> this:
>
> drwxr-xr-x ... ...
>
>
> The x on a directory means search, not execute. If you can't search
> the directory, you can't read the files in it.
>
> If you want people to be able to find the files but not list the
> directory when they're on the server, you can set the directory as 711
> which would look like:
>
> drwx--x--x ... ...
>
>
>
> >Frizzle.
> >
> >
> >Code sofar below:
> >
> >
> >++++++++++++++ ++++++++++++
> ><?php
> >
> > require_once('. ./inc/globals.php');
> >
> > if( isset( $_FILES['image'] ) ){
> >
> >$ftp_conn = @ftp_connect( $default_ftp_se rver )or
> >die('<b>Error! </b>');
> >@ftp_login( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
> >die('<bError !</b>');
> >
> >$uploaddir = '../items/';
> >$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );
> >
> >if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile) ){
> > echo "File is valid, and was successfully uploaded.";
> >} else {
> > echo "Possible file upload attack!";
> >};
> >
> >ftp_close( $ftp_conn );
> >
> >};
> >
> >?>
> ><form action="<?php echo $PHP_SELF; ?>" method="post"
> >enctype="multi part/form-data" name="images" target="_top" id="images"
> >class="form" >
> > <input name="image" type="file" id="image">
> > <br>
> > <input type="submit" name="upload" id="upload" value="Upload">
> > <input name="cancel" type="button" id="cancel" value="Cancel"
> >onClick="javas cript:history.g o(-1) ">
> ></form><?php
> >
> > if (is_dir($upload dir)) {
> > if ($dh = opendir($upload dir)) {
> > while (($file = readdir($dh)) !== false) {
> > if ($file !== '..' && $file !== '.') echo "filename:$ file :
> >filetype: " . filetype($uploa ddir . $file) . "<br>\r\n";
> > }
> > closedir($dh);
> > }
> > };
> >
> >?>
> >----------------------------------------------------
> --
> gburnore at DataBasix dot Com
> ---------------------------------------------------------------------------
> How you look depends on where you go.
> ---------------------------------------------------------------------------
> Gary L. Burnore | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
> | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
> Official .sig, Accept no substitutes. | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
> | 0 1 7 2 3 / ݳ 3 7 4 9 3 0 ۳
> Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
> =============== =============== =============== =============== ===============

Hmm, i still get an error; i chmodded both the destination folder AND
the executing script-file 755.

Warning: move_uploaded_f ile(../items/bg.jpg): failed to open stream:
Permission denied in
/home/httpd/vhosts/domain.com/httpdocs/new/admin/ftptest.php on line 15

Read mode Write mode Execute/search mode
Owner + + +
Group + - +
Others + - +

Frizzle.


Standard (DW created files/dirs) have user 'domainname', permissions
'rwx r-x r-x ',
Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
--- --- '

Frizzle.


Is there a possibility to upload files via PHP without Chmodding, and
keep the same group / permissions on uploaded files as those uploaded
with, say, DreamWeaver or WS_FTP ?

Frizzle.

(E.g. with ftp_put() wich i can't seem to get working.)

Apr 5 '06 #5
I have a semi related chmod question that i think i know the answer too
alredy but just want to be sure...

Is it possible using PHP to set the permissions on a folder created from
within a php application...
"frizzle" <ph********@gma il.com> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
Hi,

I am at the base of an FTP thingy i'm building, and i noticed that
it would only work if i chmod the folder 777, i thought to remember
correctly that previously on another site chmod 744 was enough,
now it isn't.
Am i mistaking, and should it always be 777 ? And isn't a chmodded
777 folder much more vulnerable?

Frizzle.
Code sofar below:
+++++++++++++++ +++++++++++
<?php

require_once('. ./inc/globals.php');

if( isset( $_FILES['image'] ) ){

$ftp_conn = @ftp_connect( $default_ftp_se rver )or
die('<b>Error!</b>');
@ftp_login( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
die('<bError!</b>');

$uploaddir = '../items/';
$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );

if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile ) ){
echo "File is valid, and was successfully uploaded.";
} else {
echo "Possible file upload attack!";
};

ftp_close( $ftp_conn );

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multip art/form-data" name="images" target="_top" id="images"
class="form">
<input name="image" type="file" id="image">
<br>
<input type="submit" name="upload" id="upload" value="Upload">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javasc ript:history.go (-1) ">
</form><?php

if (is_dir($upload dir)) {
if ($dh = opendir($upload dir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '..' && $file !== '.') echo "filename: $file :
filetype: " . filetype($uploa ddir . $file) . "<br>\r\n";
}
closedir($dh);
}
};

?>
----------------------------------------------------

Apr 5 '06 #6
frizzle wrote:
frizzle wrote:
bobzimuta wrote:
Are you allowing your web server write permissions to the folder?
Assuming the webserver runs as 'nobody' .
755 with ownership nobody, nobody . Otherwise you'll need
775 with ownership frizzle, nobody
frizzle wrote:

Gary L. Burnore wrote:

>On 4 Apr 2006 15:10:39 -0700, "frizzle" <ph********@gma il.com> wrote:
>
>
>>Hi,
>>
>>I am at the base of an FTP thingy i'm building, and i noticed that
>>it would only work if i chmod the folder 777, i thought to remember
>>correct ly that previously on another site chmod 744 was enough,
>>now it isn't.
>>Am i mistaking, and should it always be 777 ? And isn't a chmodded
>>777 folder much more vulnerable?
>
>
>Most definitely more vulnerable.
>
>
>You want 755, not 744. You need the x bit set. It should look like
>this:
>
>drwxr-xr-x ... ...
>
>
>The x on a directory means search, not execute. If you can't search
>the directory, you can't read the files in it.
>
>If you want people to be able to find the files but not list the
>director y when they're on the server, you can set the directory as 711
>which would look like:
>
>drwx--x--x ... ...
>
>
>
>
>>Frizzle .
>>
>>
>>Code sofar below:
>>
>>
>>+++++++++ +++++++++++++++ ++
>><?php
>>
>> require_once('. ./inc/globals.php');
>>
>> if( isset( $_FILES['image'] ) ){
>>
>>$ftp_co nn = @ftp_connect( $default_ftp_se rver )or
>>die('<b>E rror!</b>');
>>@ftp_logi n( $ftp_conn, $default_ftp_us er, $default_ftp_pa ss )or
>>die('<bEr ror!</b>');
>>
>>$uploaddi r = '../items/';
>>$uploadfi le = $uploaddir . basename( $_FILES['image']['name'] );
>>
>>if ( move_uploaded_f ile( $_FILES['image']['tmp_name'], $uploadfile ) ){
>> echo "File is valid, and was successfully uploaded.";
>>} else {
>> echo "Possible file upload attack!";
>>};
>>
>>ftp_close ( $ftp_conn );
>>
>>};
>>
>>?>
>><form action="<?php echo $PHP_SELF; ?>" method="post"
>>enctype=" multipart/form-data" name="images" target="_top" id="images"
>>class="fo rm">
>> <input name="image" type="file" id="image">
>> <br>
>> <input type="submit" name="upload" id="upload" value="Upload">
>> <input name="cancel" type="button" id="cancel" value="Cancel"
>>onClick=" javascript:hist ory.go(-1) ">
>></form><?php
>>
>> if (is_dir($upload dir)) {
>> if ($dh = opendir($upload dir)) {
>> while (($file = readdir($dh)) !== false) {
>> if ($file !== '..' && $file !== '.') echo "filename: $file :
>>filetyp e: " . filetype($uploa ddir . $file) . "<br>\r\n";
>> }
>> closedir($dh);
>> }
>> };
>>
>>?>
>>----------------------------------------------------
>
>--
>gburnore at DataBasix dot Com
>---------------------------------------------------------------------------
> How you look depends on where you go.
>---------------------------------------------------------------------------
>Gary L. Burnore | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
> | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
>Official .sig, Accept no substitutes. | ۳ݳ޳ݳۺ ݳ޳ݳݳ޳ݳ ۳
> | 0 1 7 2 3 / ݳ 3 7 4 9 3 0 ۳
>Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
>========== =============== =============== =============== =============== =====

Hmm, i still get an error; i chmodded both the destination folder AND
the executing script-file 755.

Warning: move_uploaded_f ile(../items/bg.jpg): failed to open stream:
Permissio n denied in
/home/httpd/vhosts/domain.com/httpdocs/new/admin/ftptest.php on line 15

Read mode Write mode Execute/search mode
Owner + + +
Group + - +
Others + - +

Frizzle.


Standard (DW created files/dirs) have user 'domainname', permissions
'rwx r-x r-x ',
Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
--- --- '

Frizzle.

Is there a possibility to upload files via PHP without Chmodding, and
keep the same group / permissions on uploaded files as those uploaded
with, say, DreamWeaver or WS_FTP ?

Frizzle.

(E.g. with ftp_put() wich i can't seem to get working.)


Only if you can ftp in as the web server.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 5 '06 #7
Chris H wrote:
I have a semi related chmod question that i think i know the answer too
alredy but just want to be sure...

Is it possible using PHP to set the permissions on a folder created from
within a php application...


Depends on your hosting company. If they allow it, yes.

If the php application created it, the owner will be the user running the
application - in the case of a web application, it would be the webserver's
userid. So the application would be able to chmod the directory.

However, if the directory is created by ftp (as another user), no, you won't be
able to chmod the directory - at least not without going through a lot of hoops.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 5 '06 #8
Gary L. Burnore wrote:
On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@attg lobal.net> wrote:
.
Standard (DW created files/dirs) have user 'domainname', permissions
'rwx r-x r-x ',
Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
--- --- '

Frizzle.
Is there a possibility to upload files via PHP without Chmodding, and
keep the same group / permissions on uploaded files as those uploaded
with, say, DreamWeaver or WS_FTP ?

Frizzle.

(E.g. with ftp_put() wich i can't seem to get working.)


Only if you can ftp in as the web server.

It depends on the ftp server, actually. Our ftp server correctly sets
the permissions for you when you push. Seems your ISP has something
set incorrectly.


No, he was asking how to upload files with PHP - not with FTP.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 5 '06 #9

Jerry Stuckle wrote:
Gary L. Burnore wrote:
On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@attg lobal.net> wrote:
.
>Standard (DW created files/dirs) have user 'domainname', permissions
>'rwx r-x r-x ',
>Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>--- --- '
>
>Frizzle.
Is there a possibility to upload files via PHP without Chmodding, and
keep the same group / permissions on uploaded files as those uploaded
with, say, DreamWeaver or WS_FTP ?

Frizzle.

(E.g. with ftp_put() wich i can't seem to get working.)
Only if you can ftp in as the web server.

It depends on the ftp server, actually. Our ftp server correctly sets
the permissions for you when you push. Seems your ISP has something
set incorrectly.


No, he was asking how to upload files with PHP - not with FTP.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===


Sorry, kind of lost it here; is it possible to FTP via PHP w/o any
chmodding etc.
So i could mail a zipfile to a client, tell them to unpack it and
upload it, and
have the upload script up and running ... ?

Frizzle.

Apr 5 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
16819
by: Daniel | last post by:
Hi, From what I read from the PHP manual, chmod on a Windows platform should have no effect, and that seems totally normal (unless someone on sourceforge has a windows port of that!). I create a directory on my Windows box, and set chmod 777 on it (that should be full access for everyone if my memory serves me correctly), but when I want to rmdir that directory, I get a permission denied message (I can delete contents from that...
6
6705
by: Ask Josephsen | last post by:
Hi NG If I write the following: <?php $file="myfile.JPG"; if ( getmyuid()==fileowner ( $file ) ) { chgrp ( $file, getmygid() ); chown ( $file, getmyuid() );
1
4703
by: Xuan Yuan | last post by:
I'm using Windows XP Professional and have no FTP installed. Instead, I use Command Promt. I need to CHMOD a PHP file, so I type "CHMOD 775 file-path",but get "'CHMOD'is not recognized as an internal or external command,operable program or batch file"!Is this because I spelled it wrong?Or is it the computer's problem?
4
4839
by: Ian N | last post by:
Hi i'm having a problem with file permissions of upload, they appear to be being set to only readable by the administrator, so anyone browsing the site gets a 403 forbidden error when they try and view the image. I've tried adding the following line: - chmod($uploadfile, 444); and also a few variations on it but to no avail.
5
9558
by: Stewart | last post by:
Hi, I'm working on a program in VC++ right now that needs to set file permissions of a given file to 766 (read/write/execute). Now I've found the _chmod() function in the API help docs, but that only caters for read/write. Is there ANY way of setting 766 to a file through C++ at all? Many thanks. Mike
2
2922
by: Freebird | last post by:
Hello everyone, =] I need your help, I'm creating a script that will work in many servers, and there's this part, where you can update a list, so the script goes from the client's machine to the central server, opens the file, and in adda line by line in the client server, it's all working fine, but there's a problem, this list, can't be available to others, because if I do this:
1
2992
by: James Colannino | last post by:
Ok, so now I have a very interesting problem, this time related to os.chmod. I have the following in a text file: 0600. My script reads that number as a string and converts it to an integer for use with chmod. However, when I do this, instead of the rw------ permissions that I expect, I get ---x-wx--T. I tried placing 0600 directly in the command (chmod(filename, 0600)), and that worked as expected (I got rw------). So then I entered...
3
3772
by: webhead | last post by:
I have a web where users can upload photos, but they want to also be able to delete them. The directory can have chmod changes but it won't let me chmod the files and unlink them. I'm assuming it really is a chmod problem even though the error message is "no such file or directory", as I'm sure the name and path are right. Even my ftp program won't let me chmod the files, is this a safemode problem?
3
4769
by: Rik | last post by:
Hello, first of all, my provider sucks, newsserver is down for the #nth time now, offcourse when I have an urgent question.... So this will be me first time using Google Groups, forgive me if something goes wrong. The problem at hand: In a restricted area I let a user upload an image, no problem The image gets scaled down with imagecopyresampled(), and stored with imagejpeg($resized_img,'/path/to/target/image.jpg')
1
3218
by: lawrence k | last post by:
I've a simple script to transfer some files from one domain to another, with both domains living on the same server. The files in both directories are already chmod 777. Yet after transfer, I try to ensure that the file is 777, and I get an error. Why? for ($i=0; $i < count($transferArray); $i++) { $fileName = $transferArray; $commandAsString = "\cp -f /var/www/vhosts/mydomain.com/httpdocs/ site_specific_files/$fileName...
0
10692
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10766
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9525
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5753
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5946
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4167
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.