473,890 Members | 2,014 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
47 3362
frizzle wrote:
Jerry Stuckle wrote:
Gary L. Burnore wrote:
On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@a ttglobal.net> wrote:
.
>>Standar d (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*******@att global.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.


Frizzle,

No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
web server are.

When you ftp a file to the server, the owner of the file is the userid who
uploaded the file (signed into ftp). But when you upload via PHP, you're using
the web server, and the owner is the userid of the server itself.

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

Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
Gary L. Burnore wrote:

On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@a ttglobal.net> wrote:
.
>>>Standar d (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*******@att global.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.


Frizzle,

No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
web server are.

When you ftp a file to the server, the owner of the file is the userid who
uploaded the file (signed into ftp). But when you upload via PHP, you're using
the web server, and the owner is the userid of the server itself.

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


Ok, thanks.
Not to go on and on about this, but the other thing i asked is
impossible as well then?

"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 6 '06 #12
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
Gary L. Burnore wrote:
>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
><js******* @attglobal.net> wrote:
>.
>
>
>
>>>>Standar d (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 ?
>>>
>>>Frizzl e.
>>>
>>>(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*******@a ttglobal.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.


Frizzle,

No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
web server are.

When you ftp a file to the server, the owner of the file is the userid who
uploaded the file (signed into ftp). But when you upload via PHP, you're using
the web server, and the owner is the userid of the server itself.

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

Ok, thanks.
Not to go on and on about this, but the other thing i asked is
impossible as well then?

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


It's easy to ftp or to upload via PHP. Both work quite well (unless the
server's configuration is screwed up). It's when you try to mix the two you
start running into permission problems and need to chmod.

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

Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

Jerry Stuckle wrote:
>Gary L. Burnore wrote:
>
>
>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>><js******* @attglobal.net> wrote:
>>.
>>
>>
>>
>>>>>Standar d (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 ?
>>>>
>>>>Frizzl e.
>>>>
>>>>(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*******@a ttglobal.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.
Frizzle,

No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
web server are.

When you ftp a file to the server, the owner of the file is the userid who
uploaded the file (signed into ftp). But when you upload via PHP, you're using
the web server, and the owner is the userid of the server itself.

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

Ok, thanks.
Not to go on and on about this, but the other thing i asked is
impossible as well then?

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


It's easy to ftp or to upload via PHP. Both work quite well (unless the
server's configuration is screwed up). It's when you try to mix the two you
start running into permission problems and need to chmod.

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


owkaaaaayyyy, i never realized ftp and uploading aren't the same
thing...
I don't need to mix them, i need a script to upload files, wich can
prefferably
run without any chmodding etc.

Frizzle.

Apr 6 '06 #14
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>Jerry Stuckle wrote:
>
>
>
>>Gary L. Burnore wrote:
>>
>>
>>
>>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>>><js***** **@attglobal.ne t> wrote:
>>>.
>>>
>>>
>>>
>>>
>>>>>>Stand ard (DW created files/dirs) have user 'domainname', permissions
>>>>>>'rw x r-x r-x ',
>>>>>>Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>>>>>>--- --- '
>>>>>>
>>>>>>Frizz le.
>>>>>
>>>>>
>>>>>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 ?
>>>>>
>>>>>Frizzl e.
>>>>>
>>>>>(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******* @attglobal.net
>>========= =========
>
>
>Sorry, kind of lost it here; is it possible to FTP via PHP w/o any
>chmoddin g 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.
>

Frizzle,

No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
web server are.

When you ftp a file to the server, the owner of the file is the userid who
uploaded the file (signed into ftp). But when you upload via PHP, you're using
the web server, and the owner is the userid of the server itself.

--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@a ttglobal.net
=========== =======
Ok, thanks.
Not to go on and on about this, but the other thing i asked is
impossible as well then?

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


It's easy to ftp or to upload via PHP. Both work quite well (unless the
server's configuration is screwed up). It's when you try to mix the two you
start running into permission problems and need to chmod.

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

owkaaaaayyyy, i never realized ftp and uploading aren't the same
thing...
I don't need to mix them, i need a script to upload files, wich can
prefferably
run without any chmodding etc.

Frizzle.


Ok, you just need to ensure you have the original directory permissions set
properly, then. In a typical installation the directory would be owned by the
webserver's userid with permissions of 755.

And I hope I didn't confuse you. You can upload via HTTP, or with the ftp PUT
command. In either case the file ends up on the server. But how it gets there
is much different.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 6 '06 #15

Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

Jerry Stuckle wrote:
>frizzle wrote:
>
>
>>Jerry Stuckle wrote:
>>
>>
>>
>>>Gary L. Burnore wrote:
>>>
>>>
>>>
>>>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>>>><js***** **@attglobal.ne t> wrote:
>>>>.
>>>>
>>>>
>>>>
>>>>
>>>>>>>Stand ard (DW created files/dirs) have user 'domainname', permissions
>>>>>>>'rw x r-x r-x ',
>>>>>>>Ftp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>>>>>>>--- --- '
>>>>>>>
>>>>>>>Frizz le.
>>>>>>
>>>>>>
>>>>>>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 ?
>>>>>>
>>>>>>Frizzl e.
>>>>>>
>>>>>>(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******* @attglobal.net
>>>========= =========
>>
>>
>>Sorry, kind of lost it here; is it possible to FTP via PHP w/o any
>>chmoddin g 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.
>>
>
>Frizzle,
>
>No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
>web server are.
>
>When you ftp a file to the server, the owner of the file is the userid who
>uploaded the file (signed into ftp). But when you upload via PHP, you're using
>the web server, and the owner is the userid of the server itself.
>
>--
>=========== =======
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@a ttglobal.net
>=========== =======
Ok, thanks.
Not to go on and on about this, but the other thing i asked is
impossible as well then?

"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.
It's easy to ftp or to upload via PHP. Both work quite well (unless the
server's configuration is screwed up). It's when you try to mix the two you
start running into permission problems and need to chmod.

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

owkaaaaayyyy, i never realized ftp and uploading aren't the same
thing...
I don't need to mix them, i need a script to upload files, wich can
prefferably
run without any chmodding etc.

Frizzle.


Ok, you just need to ensure you have the original directory permissions set
properly, then. In a typical installation the directory would be owned by the
webserver's userid with permissions of 755.

And I hope I didn't confuse you. You can upload via HTTP, or with the ftp PUT
command. In either case the file ends up on the server. But how it gets there
is much different.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===


When i create a new folder, either via Plesk, Dreamweaver or WS_FTP,
folders are standard chmodded 755.
That should be allright then ...

Frizzle.

Apr 6 '06 #16
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>Jerry Stuckle wrote:
>
>
>
>>frizzle wrote:
>>
>>
>>
>>>Jerry Stuckle wrote:
>>>
>>>
>>>
>>>
>>>>Gary L. Burnore wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>>>>><js*** ****@attglobal. net> wrote:
>>>>>.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>>Sta ndard (DW created files/dirs) have user 'domainname', permissions
>>>>>>>>'rw x r-x r-x ',
>>>>>>>>F tp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>>>>>>>>--- --- '
>>>>>>>>
>
>
>>>>>>>>Fri zzle.
>>>>>>>
>>>>>>>
>>>>>>>Is there a possibility to upload files via PHP without Chmodding, and
>>>>>>>ke ep the same group / permissions on uploaded files as those uploaded
>>>>>>>with , say, DreamWeaver or WS_FTP ?
>>>>>>>
>>>>>>>Friz zle.
>>>>>>>
>>>>>>>(E.g . with ftp_put() wich i can't seem to get working.)
>>>>>>>
>>>>>>
>>>>>>Onl y 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.
>>>>
>>>>--
>>>>======= ===========
>>>>Remov e the "x" from my email address
>>>>Jerry Stuckle
>>>>JDS Computer Training Corp.
>>>>js***** **@attglobal.ne t
>>>>======= ===========
>>>
>>>
>>>Sorry, kind of lost it here; is it possible to FTP via PHP w/o any
>>>chmoddin g 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 ... ?
>>>
>>>Frizzl e.
>>>
>>
>>Frizzle ,
>>
>>No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
>>web server are.
>>
>>When you ftp a file to the server, the owner of the file is the userid who
>>uploade d the file (signed into ftp). But when you upload via PHP, you're using
>>the web server, and the owner is the userid of the server itself.
>>
>>--
>>========= =========
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js******* @attglobal.net
>>========= =========
>
>
>Ok, thanks.
>Not to go on and on about this, but the other thing i asked is
>impossib le as well then?
>
> "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.
>

It's easy to ftp or to upload via PHP. Both work quite well (unless the
server's configuration is screwed up). It's when you try to mix the two you
start running into permission problems and need to chmod.

--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@a ttglobal.net
=========== =======
owkaaaaayyyy , i never realized ftp and uploading aren't the same
thing...
I don't need to mix them, i need a script to upload files, wich can
prefferabl y
run without any chmodding etc.

Frizzle.


Ok, you just need to ensure you have the original directory permissions set
properly, then. In a typical installation the directory would be owned by the
webserver's userid with permissions of 755.

And I hope I didn't confuse you. You can upload via HTTP, or with the ftp PUT
command. In either case the file ends up on the server. But how it gets there
is much different.
--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====

When i create a new folder, either via Plesk, Dreamweaver or WS_FTP,
folders are standard chmodded 755.
That should be allright then ...

Frizzle.


*Should be* is the key. If your host has things set ip properly, then yes you
should be OK. But if not...

And I'm not sure about Plesk, but I know DreamWeaver and WS_FTP both use ftp to
transfer files. I suspect Plesk does, also.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 7 '06 #17

Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

Jerry Stuckle wrote:
>frizzle wrote:
>
>
>>Jerry Stuckle wrote:
>>
>>
>>
>>>frizzle wrote:
>>>
>>>
>>>
>>>>Jerry Stuckle wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>Gary L. Burnore wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>>>>>><js*** ****@attglobal. net> wrote:
>>>>>>.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>>Sta ndard (DW created files/dirs) have user 'domainname', permissions
>>>>>>>>>'rw x r-x r-x ',
>>>>>>>>>F tp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>>>>>>>>>--- --- '
>>>>>>>>>
>>
>>
>>>>>>>>>Fri zzle.
>>>>>>>>
>>>>>>>>
>>>>>>>>Is there a possibility to upload files via PHP without Chmodding, and
>>>>>>>>ke ep the same group / permissions on uploaded files as those uploaded
>>>>>>>>with , say, DreamWeaver or WS_FTP ?
>>>>>>>>
>>>>>>>>Friz zle.
>>>>>>>>
>>>>>>>>(E.g . with ftp_put() wich i can't seem to get working.)
>>>>>>>>
>>>>>>>
>>>>>>>Onl y 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.
>>>>>
>>>>>--
>>>>>======= ===========
>>>>>Remov e the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>js***** **@attglobal.ne t
>>>>>======= ===========
>>>>
>>>>
>>>>Sorry, kind of lost it here; is it possible to FTP via PHP w/o any
>>>>chmoddin g 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 ... ?
>>>>
>>>>Frizzl e.
>>>>
>>>
>>>Frizzle ,
>>>
>>>No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
>>>web server are.
>>>
>>>When you ftp a file to the server, the owner of the file is the userid who
>>>uploade d the file (signed into ftp). But when you upload via PHP, you're using
>>>the web server, and the owner is the userid of the server itself.
>>>
>>>--
>>>========= =========
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>js******* @attglobal.net
>>>========= =========
>>
>>
>>Ok, thanks.
>>Not to go on and on about this, but the other thing i asked is
>>impossib le as well then?
>>
>> "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.
>>
>
>It's easy to ftp or to upload via PHP. Both work quite well (unless the
>server's configuration is screwed up). It's when you try to mix the two you
>start running into permission problems and need to chmod.
>
>--
>=========== =======
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@a ttglobal.net
>=========== =======
owkaaaaayyyy , i never realized ftp and uploading aren't the same
thing...
I don't need to mix them, i need a script to upload files, wich can
prefferabl y
run without any chmodding etc.

Frizzle.
Ok, you just need to ensure you have the original directory permissions set
properly, then. In a typical installation the directory would be owned by the
webserver's userid with permissions of 755.

And I hope I didn't confuse you. You can upload via HTTP, or with the ftp PUT
command. In either case the file ends up on the server. But how it gets there
is much different.
--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====

When i create a new folder, either via Plesk, Dreamweaver or WS_FTP,
folders are standard chmodded 755.
That should be allright then ...

Frizzle.


*Should be* is the key. If your host has things set ip properly, then yes you
should be OK. But if not...

And I'm not sure about Plesk, but I know DreamWeaver and WS_FTP both use ftp to
transfer files. I suspect Plesk does, also.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===


Well, ok, but where should i focus now to build a script to upload
files to my server?
FTP, or an other file transfer method?
It would be ideal if i could also create / delete folders ...

Frizzle.

Apr 7 '06 #18
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>Jerry Stuckle wrote:
>
>
>
>>frizzle wrote:
>>
>>
>>
>>>Jerry Stuckle wrote:
>>>
>>>
>>>
>>>
>>>>frizz le wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>Jerr y Stuckle wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Gar y L. Burnore wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>>>>>>><js* ******@attgloba l.net> wrote:
>>>>>>>.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>>S tandard (DW created files/dirs) have user 'domainname', permissions
>>>>>>>>>>' rwx r-x r-x ',
>>>>>>>>>>F tp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>>>>>>>>> >--- --- '
>>>>>>>>> >
>>>
>>>
>>>>>>>>>>F rizzle.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Is there a possibility to upload files via PHP without Chmodding, and
>>>>>>>>>ke ep the same group / permissions on uploaded files as those uploaded
>>>>>>>>>wi th, say, DreamWeaver or WS_FTP ?
>>>>>>>>>
>>>>>>>>>Fr izzle.
>>>>>>>>>
>>>>>>>>>(E .g. with ftp_put() wich i can't seem to get working.)
>>>>>>>>>
>>>>>>>>
>>>>>>>>Onl y if you can ftp in as the web server.
>>>>>>>
>>>>>>>
>>>>>>>It depends on the ftp server, actually. Our ftp server correctly sets
>>>>>>>th e permissions for you when you push. Seems your ISP has something
>>>>>>>se t incorrectly.
>>>>>>>
>>>>>>
>>>>>>No, he was asking how to upload files with PHP - not with FTP.
>>>>>>
>>>>>>--
>>>>>>===== =============
>>>>>>Remov e the "x" from my email address
>>>>>>Jer ry Stuckle
>>>>>>JDS Computer Training Corp.
>>>>>>js*** ****@attglobal. net
>>>>>>===== =============
>>>>>
>>>>>
>>>>>Sorr y, kind of lost it here; is it possible to FTP via PHP w/o any
>>>>>chmodd ing etc.
>>>>>So i could mail a zipfile to a client, tell them to unpack it and
>>>>>uplo ad it, and
>>>>>have the upload script up and running ... ?
>>>>>
>>>>>Frizzl e.
>>>>>
>>>>
>>>>Frizzle ,
>>>>
>>>>No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
>>>>web server are.
>>>>
>>>>When you ftp a file to the server, the owner of the file is the userid who
>>>>uploade d the file (signed into ftp). But when you upload via PHP, you're using
>>>>the web server, and the owner is the userid of the server itself.
>>>>
>>>>--
>>>>======= ===========
>>>>Remov e the "x" from my email address
>>>>Jerry Stuckle
>>>>JDS Computer Training Corp.
>>>>js***** **@attglobal.ne t
>>>>======= ===========
>>>
>>>
>>>Ok, thanks.
>>>Not to go on and on about this, but the other thing i asked is
>>>impossib le as well then?
>>>
>>> "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 ... ?"
>>>
>>>Frizzl e.
>>>
>>
>>It's easy to ftp or to upload via PHP. Both work quite well (unless the
>>server' s configuration is screwed up). It's when you try to mix the two you
>>start running into permission problems and need to chmod.
>>
>>--
>>========= =========
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js******* @attglobal.net
>>========= =========
>
>
>owkaaaaayy yy, i never realized ftp and uploading aren't the same
>thing...
>I don't need to mix them, i need a script to upload files, wich can
>prefferabl y
>run without any chmodding etc.
>
>Frizzle.
>

Ok, you just need to ensure you have the original directory permissions set
properly, then. In a typical installation the directory would be owned by the
webserver 's userid with permissions of 755.

And I hope I didn't confuse you. You can upload via HTTP, or with the ftp PUT
command. In either case the file ends up on the server. But how it gets there
is much different.
--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@a ttglobal.net
=========== =======
When i create a new folder, either via Plesk, Dreamweaver or WS_FTP,
folders are standard chmodded 755.
That should be allright then ...

Frizzle.


*Should be* is the key. If your host has things set ip properly, then yes you
should be OK. But if not...

And I'm not sure about Plesk, but I know DreamWeaver and WS_FTP both use ftp to
transfer files. I suspect Plesk does, also.
--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====

Well, ok, but where should i focus now to build a script to upload
files to my server?
FTP, or an other file transfer method?
It would be ideal if i could also create / delete folders ...

Frizzle.

Frizzle,

It depends on how you want to do things. If you're going to be the only one
uploading, you can do ftp or http uploads. If you have users who may not be
familiar with ftp, you should do http uploads.

The downside of http uploads is you can't synchronize files between your local
copy and the website with products like Dreamweaver.

You can create and delete directories in PHP also, assuming your host hasn't
disabled these functions and you have the appropriate permissions. So that's
not a problem.

It's all in how you want to maintain your site.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 7 '06 #19

Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

Jerry Stuckle wrote:
>frizzle wrote:
>
>
>>Jerry Stuckle wrote:
>>
>>
>>
>>>frizzle wrote:
>>>
>>>
>>>
>>>>Jerry Stuckle wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>frizz le wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Jerr y Stuckle wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Gar y L. Burnore wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
>>>>>>>><js* ******@attgloba l.net> wrote:
>>>>>>>>.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>>>S tandard (DW created files/dirs) have user 'domainname', permissions
>>>>>>>>>>>' rwx r-x r-x ',
>>>>>>>>>>>F tp app uploaded (with chmod 777) have user 'apache', permissions 'rw-
>>>>>>>>>> >--- --- '
>>>>>>>>>> >
>>>>
>>>>
>>>>>>>>>>>F rizzle.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Is there a possibility to upload files via PHP without Chmodding, and
>>>>>>>>>>ke ep the same group / permissions on uploaded files as those uploaded
>>>>>>>>>>wi th, say, DreamWeaver or WS_FTP ?
>>>>>>>>>>
>>>>>>>>>>Fr izzle.
>>>>>>>>>>
>>>>>>>>>>(E .g. with ftp_put() wich i can't seem to get working.)
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>Onl y if you can ftp in as the web server.
>>>>>>>>
>>>>>>>>
>>>>>>>>It depends on the ftp server, actually. Our ftp server correctly sets
>>>>>>>>th e permissions for you when you push. Seems your ISP has something
>>>>>>>>se t incorrectly.
>>>>>>>>
>>>>>>>
>>>>>>>No, he was asking how to upload files with PHP - not with FTP.
>>>>>>>
>>>>>>>--
>>>>>>>===== =============
>>>>>>>Remov e the "x" from my email address
>>>>>>>Jer ry Stuckle
>>>>>>>JDS Computer Training Corp.
>>>>>>>js*** ****@attglobal. net
>>>>>>>===== =============
>>>>>>
>>>>>>
>>>>>>Sorr y, kind of lost it here; is it possible to FTP via PHP w/o any
>>>>>>chmodd ing etc.
>>>>>>So i could mail a zipfile to a client, tell them to unpack it and
>>>>>>uplo ad it, and
>>>>>>have the upload script up and running ... ?
>>>>>>
>>>>>>Frizzl e.
>>>>>>
>>>>>
>>>>>Frizzle ,
>>>>>
>>>>>No, you can't upload via PHP. FTP is a system service, just as telnet, ssh and
>>>>>web server are.
>>>>>
>>>>>When you ftp a file to the server, the owner of the file is the userid who
>>>>>uploade d the file (signed into ftp). But when you upload via PHP, you're using
>>>>>the web server, and the owner is the userid of the server itself.
>>>>>
>>>>>--
>>>>>======= ===========
>>>>>Remov e the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>js***** **@attglobal.ne t
>>>>>======= ===========
>>>>
>>>>
>>>>Ok, thanks.
>>>>Not to go on and on about this, but the other thing i asked is
>>>>impossib le as well then?
>>>>
>>>> "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 ... ?"
>>>>
>>>>Frizzl e.
>>>>
>>>
>>>It's easy to ftp or to upload via PHP. Both work quite well (unless the
>>>server' s configuration is screwed up). It's when you try to mix the two you
>>>start running into permission problems and need to chmod.
>>>
>>>--
>>>========= =========
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>js******* @attglobal.net
>>>========= =========
>>
>>
>>owkaaaaayy yy, i never realized ftp and uploading aren't the same
>>thing...
>>I don't need to mix them, i need a script to upload files, wich can
>>prefferabl y
>>run without any chmodding etc.
>>
>>Frizzle.
>>
>
>Ok, you just need to ensure you have the original directory permissions set
>properly, then. In a typical installation the directory would be owned by the
>webserver 's userid with permissions of 755.
>
>And I hope I didn't confuse you. You can upload via HTTP, or with the ftp PUT
>command. In either case the file ends up on the server. But how it gets there
>is much different.
>
>
>--
>=========== =======
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@a ttglobal.net
>=========== =======
When i create a new folder, either via Plesk, Dreamweaver or WS_FTP,
folders are standard chmodded 755.
That should be allright then ...

Frizzle.
*Should be* is the key. If your host has things set ip properly, then yes you
should be OK. But if not...

And I'm not sure about Plesk, but I know DreamWeaver and WS_FTP both use ftp to
transfer files. I suspect Plesk does, also.
--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====

Well, ok, but where should i focus now to build a script to upload
files to my server?
FTP, or an other file transfer method?
It would be ideal if i could also create / delete folders ...

Frizzle.

Frizzle,

It depends on how you want to do things. If you're going to be the only one
uploading, you can do ftp or http uploads. If you have users who may not be
familiar with ftp, you should do http uploads.

The downside of http uploads is you can't synchronize files between your local
copy and the website with products like Dreamweaver.

You can create and delete directories in PHP also, assuming your host hasn't
disabled these functions and you have the appropriate permissions. So that's
not a problem.

It's all in how you want to maintain your site.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===


It's meant for a user based site; users with certain priviledges are
allowed to add news and files to the site. No synchronizing
needed. Mostly images and mp3's, maybe some docs etc.

Frizzle.

Apr 7 '06 #20

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

Similar topics

5
16822
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
6706
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
4840
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
9559
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
2923
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
2993
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
11207
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10794
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
10896
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
10443
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
9612
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 project—planning, coding, testing, and deployment—without 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...
0
7153
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5830
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
6031
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4652
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.