By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,703 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,703 IT Pros & Developers. It's quick & easy.

Chmod

P: n/a
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_server )or
die('<b>Error!</b>');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<bError!</b>');

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

if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
</form><?php

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

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

Apr 4 '06 #1
Share this Question
Share on Google+
47 Replies


P: n/a

Gary L. Burnore wrote:
On 4 Apr 2006 15:10:39 -0700, "frizzle" <ph********@gmail.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_server )or
die('<b>Error!</b>');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<bError!</b>');

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

if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
</form><?php

if (is_dir($uploaddir)) {
if ($dh = opendir($uploaddir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '..' && $file !== '.') echo "filename: $file:
filetype: " . filetype($uploaddir . $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_file(../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

P: n/a
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********@gmail.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_server )or
die('<b>Error!</b>');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<bError!</b>');

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

if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
</form><?php

if (is_dir($uploaddir)) {
if ($dh = opendir($uploaddir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '..' && $file !== '.') echo "filename: $file :
filetype: " . filetype($uploaddir . $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_file(../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

P: n/a

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********@gmail.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_server )or
>die('<b>Error!</b>');
>@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
>die('<bError!</b>');
>
>$uploaddir = '../items/';
>$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );
>
>if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
></form><?php
>
> if (is_dir($uploaddir)) {
> if ($dh = opendir($uploaddir)) {
> while (($file = readdir($dh)) !== false) {
> if ($file !== '..' && $file !== '.') echo "filename: $file :
>filetype: " . filetype($uploaddir . $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_file(../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

P: n/a

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********@gmail.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_server )or
> >die('<b>Error!</b>');
> >@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
> >die('<bError!</b>');
> >
> >$uploaddir = '../items/';
> >$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );
> >
> >if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
> ></form><?php
> >
> > if (is_dir($uploaddir)) {
> > if ($dh = opendir($uploaddir)) {
> > while (($file = readdir($dh)) !== false) {
> > if ($file !== '..' && $file !== '.') echo "filename:$file :
> >filetype: " . filetype($uploaddir . $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_file(../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

P: n/a
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********@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.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_server )or
die('<b>Error!</b>');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<bError!</b>');

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

if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
</form><?php

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

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

Apr 5 '06 #6

P: n/a
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********@gmail.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_server )or
>>die('<b>Error!</b>');
>>@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
>>die('<bError!</b>');
>>
>>$uploaddir = '../items/';
>>$uploadfile = $uploaddir . basename( $_FILES['image']['name'] );
>>
>>if ( move_uploaded_file( $_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="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="javascript:history.go(-1) ">
>></form><?php
>>
>> if (is_dir($uploaddir)) {
>> if ($dh = opendir($uploaddir)) {
>> while (($file = readdir($dh)) !== false) {
>> if ($file !== '..' && $file !== '.') echo "filename: $file :
>>filetype: " . filetype($uploaddir . $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_file(../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.)


Only if you can ftp in as the web server.

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

P: n/a
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*******@attglobal.net
==================
Apr 5 '06 #8

P: n/a
Gary L. Burnore wrote:
On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@attglobal.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*******@attglobal.net
==================
Apr 5 '06 #9

P: n/a

Jerry Stuckle wrote:
Gary L. Burnore wrote:
On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@attglobal.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*******@attglobal.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

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
Gary L. Burnore wrote:
On Wed, 05 Apr 2006 07:55:14 -0500, Jerry Stuckle
<js*******@attglobal.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*******@attglobal.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*******@attglobal.net
==================
Apr 6 '06 #11

P: n/a

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:
.
>>>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*******@attglobal.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*******@attglobal.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

P: n/a
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:
>.
>
>
>
>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.net
==================
Apr 6 '06 #13

P: n/a

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:
>>.
>>
>>
>>
>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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

P: n/a
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:
>>>.
>>>
>>>
>>>
>>>
>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.net
==================
Apr 6 '06 #15

P: n/a

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:
>>>>.
>>>>
>>>>
>>>>
>>>>
>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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

P: n/a
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:
>>>>>.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.net
==================
Apr 7 '06 #17

P: n/a

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:
>>>>>>.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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

P: n/a
frizzle wrote:
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:
>>>>>>>.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.net
==================
Apr 7 '06 #19

P: n/a

Jerry Stuckle wrote:
frizzle wrote:
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:
>>>>>>>>.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
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:
>>>>>>>>>.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.


In that case I would suggest http uploads.

Maybe the easiest way is to have an admin page where you can let PHP create the
root directory(s) you wish, then let the main part of the site upload into these
directories and, if necessary, create new directories.

If the webserver creates them it will be the owner, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 8 '06 #21

P: n/a

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

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:
>>>>>>>>>>.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.


In that case I would suggest http uploads.

Maybe the easiest way is to have an admin page where you can let PHP create the
root directory(s) you wish, then let the main part of the site upload into these
directories and, if necessary, create new directories.

If the webserver creates them it will be the owner, also.

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


Hmm, hope i'm not back at the start (the chmodding part) i get an
error:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 10008 is not allowed to access / owned by uid 0 in
/home/httpd/vhosts/host.com/httpdocs/test/admin/ftp2.php on line 17

Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpejdmGr
[error] => 0
[size] => 11469
)

)
Does this have something to do with the Chmodding again ? (Please tell
me it doesn't...)

Frizzle.

Apr 9 '06 #22

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>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:
>>>>>>>>>>>.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.


In that case I would suggest http uploads.

Maybe the easiest way is to have an admin page where you can let PHP create the
root directory(s) you wish, then let the main part of the site upload into these
directories and, if necessary, create new directories.

If the webserver creates them it will be the owner, also.

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

Hmm, hope i'm not back at the start (the chmodding part) i get an
error:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 10008 is not allowed to access / owned by uid 0 in
/home/httpd/vhosts/host.com/httpdocs/test/admin/ftp2.php on line 17

Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpejdmGr
[error] => 0
[size] => 11469
)

)
Does this have something to do with the Chmodding again ? (Please tell
me it doesn't...)

Frizzle.


I have no idea - don't know what code you're using.

But it looks like you're trying to access the system root directory ('/') -
which is owned by root. You can't do it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 9 '06 #23

P: n/a
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

Jerry Stuckle wrote:
>frizzle wrote:
>
>
>>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:
>>>>>>>>>>>>.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.
In that case I would suggest http uploads.

Maybe the easiest way is to have an admin page where you can let PHP create the
root directory(s) you wish, then let the main part of the site upload into these
directories and, if necessary, create new directories.

If the webserver creates them it will be the owner, also.

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

Hmm, hope i'm not back at the start (the chmodding part) i get an
error:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 10008 is not allowed to access / owned by uid 0 in
/home/httpd/vhosts/host.com/httpdocs/test/admin/ftp2.php on line 17

Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpejdmGr
[error] => 0
[size] => 11469
)

)
Does this have something to do with the Chmodding again ? (Please tell
me it doesn't...)

Frizzle.


I have no idea - don't know what code you're using.

But it looks like you're trying to access the system root directory ('/') -
which is owned by root. You can't do it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

You were right, i forgot a dot (shame on me) in the path. My code is
below.
Having fixed that, it gave me the next (of how many :s ) error:

--- ERROR ---

Warning:
move_uploaded_file(/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg):
failed to open stream: Permission denied in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Warning: move_uploaded_file(): Unable to move '/tmp/phpzeJkaC' to
'/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg' in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpzeJkaC
[error] => 0
[size] => 11469
)

)

--- END ERROR ---

The folder i'm trying to access is /test/admin/uploads
and it does exist. (checked).
I hope you can tel me what's wrong. Anyway, i really appreciate all
your effort for trying to help me!

Frizzle.

My entire exact code is below:

++++++++++++++++++++++++++++++++++++++++++++++

<?php

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

/*$ftp_conn = @ftp_connect( $default_ftp_server )or
die('<b>Error!</b><br>FTP Host Niot Found!');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<b>Error!</b><br>Wrong FTP-login name or FTP-pass!');

@ftp_close( $ftp_conn );*/

if( isset( $_FILES['userfile'] ) ){
$uploaddir = './uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multipart/form-data" name="images" target="_top" id="images"
class="form">
<input name="userfile" type="file" id="userfile">
<br>
<input type="submit" name="upload" id="upload" value="Upload!">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javascript:if(confirm('Sure?')){ history.go(-1) }else{}">
</form><?php

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

?>

++++++++++++++++++++++++++++++++++++++++++++++

Apr 10 '06 #24

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>Jerry Stuckle wrote:
>
>
>
>>frizzle wrote:
>>
>>
>>
>>>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:
>>>>>>>>>>>>>.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.
>

In that case I would suggest http uploads.

Maybe the easiest way is to have an admin page where you can let PHP create the
root directory(s) you wish, then let the main part of the site upload into these
directories and, if necessary, create new directories.

If the webserver creates them it will be the owner, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Hmm, hope i'm not back at the start (the chmodding part) i get an
error:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 10008 is not allowed to access / owned by uid 0 in
/home/httpd/vhosts/host.com/httpdocs/test/admin/ftp2.php on line 17

Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpejdmGr
[error] => 0
[size] => 11469
)

)
Does this have something to do with the Chmodding again ? (Please tell
me it doesn't...)

Frizzle.


I have no idea - don't know what code you're using.

But it looks like you're trying to access the system root directory ('/') -
which is owned by root. You can't do it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


You were right, i forgot a dot (shame on me) in the path. My code is
below.
Having fixed that, it gave me the next (of how many :s ) error:

--- ERROR ---

Warning:
move_uploaded_file(/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg):
failed to open stream: Permission denied in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Warning: move_uploaded_file(): Unable to move '/tmp/phpzeJkaC' to
'/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg' in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpzeJkaC
[error] => 0
[size] => 11469
)

)

--- END ERROR ---

The folder i'm trying to access is /test/admin/uploads
and it does exist. (checked).
I hope you can tel me what's wrong. Anyway, i really appreciate all
your effort for trying to help me!

Frizzle.

My entire exact code is below:

++++++++++++++++++++++++++++++++++++++++++++++

<?php

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

/*$ftp_conn = @ftp_connect( $default_ftp_server )or
die('<b>Error!</b><br>FTP Host Niot Found!');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<b>Error!</b><br>Wrong FTP-login name or FTP-pass!');

@ftp_close( $ftp_conn );*/

if( isset( $_FILES['userfile'] ) ){
$uploaddir = './uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multipart/form-data" name="images" target="_top" id="images"
class="form">
<input name="userfile" type="file" id="userfile">
<br>
<input type="submit" name="upload" id="upload" value="Upload!">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javascript:if(confirm('Sure?')){ history.go(-1) }else{}">
</form><?php

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

?>

++++++++++++++++++++++++++++++++++++++++++++++

OK, who owns the directory, and what are its flags? And what's the userid of
the webserver?

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

P: n/a

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

Jerry Stuckle wrote:
>frizzle wrote:
>
>
>>Jerry Stuckle wrote:
>>
>>
>>
>>>frizzle wrote:
>>>
>>>
>>>
>>>>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:
>>>>>>>>>>>>>>.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.
>>
>
>In that case I would suggest http uploads.
>
>Maybe the easiest way is to have an admin page where you can let PHP create the
>root directory(s) you wish, then let the main part of the site upload into these
>directories and, if necessary, create new directories.
>
>If the webserver creates them it will be the owner, also.
>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
Hmm, hope i'm not back at the start (the chmodding part) i get an
error:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 10008 is not allowed to access / owned by uid 0 in
/home/httpd/vhosts/host.com/httpdocs/test/admin/ftp2.php on line 17

Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpejdmGr
[error] => 0
[size] => 11469
)

)
Does this have something to do with the Chmodding again ? (Please tell
me it doesn't...)

Frizzle.
I have no idea - don't know what code you're using.

But it looks like you're trying to access the system root directory ('/') -
which is owned by root. You can't do it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


You were right, i forgot a dot (shame on me) in the path. My code is
below.
Having fixed that, it gave me the next (of how many :s ) error:

--- ERROR ---

Warning:
move_uploaded_file(/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg):
failed to open stream: Permission denied in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Warning: move_uploaded_file(): Unable to move '/tmp/phpzeJkaC' to
'/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg' in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpzeJkaC
[error] => 0
[size] => 11469
)

)

--- END ERROR ---

The folder i'm trying to access is /test/admin/uploads
and it does exist. (checked).
I hope you can tel me what's wrong. Anyway, i really appreciate all
your effort for trying to help me!

Frizzle.

My entire exact code is below:

++++++++++++++++++++++++++++++++++++++++++++++

<?php

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

/*$ftp_conn = @ftp_connect( $default_ftp_server )or
die('<b>Error!</b><br>FTP Host Niot Found!');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<b>Error!</b><br>Wrong FTP-login name or FTP-pass!');

@ftp_close( $ftp_conn );*/

if( isset( $_FILES['userfile'] ) ){
$uploaddir = './uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multipart/form-data" name="images" target="_top" id="images"
class="form">
<input name="userfile" type="file" id="userfile">
<br>
<input type="submit" name="upload" id="upload" value="Upload!">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javascript:if(confirm('Sure?')){ history.go(-1) }else{}">
</form><?php

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

?>

++++++++++++++++++++++++++++++++++++++++++++++

OK, who owns the directory, and what are its flags? And what's the userid of
the webserver?

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


User: domainname
Group: psacln
Permissions: rwx r-x r-x

Userid i don't know. How could i check that ?

Frizzle.

Apr 11 '06 #26

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>Jerry Stuckle wrote:
>
>
>
>>frizzle wrote:
>>
>>
>>
>>>Jerry Stuckle wrote:
>>>
>>>
>>>
>>>
>>>>frizzle wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>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:
>>>>>>>>>>>>>>>.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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*******@attglobal.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.
>>>
>>
>>In that case I would suggest http uploads.
>>
>>Maybe the easiest way is to have an admin page where you can let PHP create the
>>root directory(s) you wish, then let the main part of the site upload into these
>>directories and, if necessary, create new directories.
>>
>>If the webserver creates them it will be the owner, also.
>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js*******@attglobal.net
>>==================
>
>
>Hmm, hope i'm not back at the start (the chmodding part) i get an
>error:
>
>Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
>script whose uid is 10008 is not allowed to access / owned by uid 0 in
>/home/httpd/vhosts/host.com/httpdocs/test/admin/ftp2.php on line 17
>
>Here is some more debugging info:Array
>(
> [userfile] => Array
> (
> [name] => photo.jpg
> [type] => image/jpeg
> [tmp_name] => /tmp/phpejdmGr
> [error] => 0
> [size] => 11469
> )
>
>)
>
>
>Does this have something to do with the Chmodding again ? (Please tell
>me it doesn't...)
>
>Frizzle.
>

I have no idea - don't know what code you're using.

But it looks like you're trying to access the system root directory ('/') -
which is owned by root. You can't do it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

You were right, i forgot a dot (shame on me) in the path. My code is
below.
Having fixed that, it gave me the next (of how many :s ) error:

--- ERROR ---

Warning:
move_uploaded_file(/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg):
failed to open stream: Permission denied in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Warning: move_uploaded_file(): Unable to move '/tmp/phpzeJkaC' to
'/home/httpd/vhosts/host.com/httpdocs/new/admin/uploads/photo.jpg' in
/home/httpd/vhosts/host.com/httpdocs/new/admin/ftp2.php on line 17

Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => photo.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpzeJkaC
[error] => 0
[size] => 11469
)

)

--- END ERROR ---

The folder i'm trying to access is /test/admin/uploads
and it does exist. (checked).
I hope you can tel me what's wrong. Anyway, i really appreciate all
your effort for trying to help me!

Frizzle.

My entire exact code is below:

+++++++++++++++++++++++++++++++++++++++++++++ +

<?php

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

/*$ftp_conn = @ftp_connect( $default_ftp_server )or
die('<b>Error!</b><br>FTP Host Niot Found!');
@ftp_login( $ftp_conn, $default_ftp_user, $default_ftp_pass )or
die('<b>Error!</b><br>Wrong FTP-login name or FTP-pass!');

@ftp_close( $ftp_conn );*/

if( isset( $_FILES['userfile'] ) ){
$uploaddir = './uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

print "</pre>";

};

?>
<form action="<?php echo $PHP_SELF; ?>" method="post"
enctype="multipart/form-data" name="images" target="_top" id="images"
class="form">
<input name="userfile" type="file" id="userfile">
<br>
<input type="submit" name="upload" id="upload" value="Upload!">
<input name="cancel" type="button" id="cancel" value="Cancel"
onClick="javascript:if(confirm('Sure?')){ history.go(-1) }else{}">
</form><?php

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

?>

+++++++++++++++++++++++++++++++++++++++++++++ +

OK, who owns the directory, and what are its flags? And what's the userid of
the webserver?

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

User: domainname
Group: psacln
Permissions: rwx r-x r-x

Userid i don't know. How could i check that ?

Frizzle.


Well, the Apache user is usually (but not always) the owner of the document root
directory. Or you can ask your webhost.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 11 '06 #27

P: n/a
try to change the temp directory to own buy your user. Your /tmp
directory maybe secured so php has a hard time putting files there.

--
Mike
http://www.xpertdns.com

Apr 12 '06 #28

P: n/a
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.

Apr 14 '06 #29

P: n/a
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.
js*******@attglobal.net
==================
Apr 14 '06 #30

P: n/a
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.
js*******@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 );

?>

Apr 14 '06 #31

P: n/a
frizzle wrote:
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.
js*******@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 );

?>


What happens if you leave off the 0755? That may be restricted in your
location. Just try it with the default.

If it still doesn't work, looks like it's time to find another host. This one
has too many restrictions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 15 '06 #32

P: n/a

Jerry Stuckle wrote:
frizzle wrote:
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.
js*******@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 );

?>


What happens if you leave off the 0755? That may be restricted in your
location. Just try it with the default.

If it still doesn't work, looks like it's time to find another host. This one
has too many restrictions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


Hmm, that's really crap. 755 does nothing more, and changing hosts
isn't really an option. ... :(

Frizzle.

Apr 17 '06 #33

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
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.
js*******@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 );

?>

What happens if you leave off the 0755? That may be restricted in your
location. Just try it with the default.

If it still doesn't work, looks like it's time to find another host. This one
has too many restrictions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Hmm, that's really crap. 755 does nothing more, and changing hosts
isn't really an option. ... :(

Frizzle.


But unfortunately, it looks like your host has too many things locked down for
you to be able to upload files through the website.

I can partially understand their reasoning in a shared environment. But at the
same time, other hosting companies can do it. So why can't they?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 17 '06 #34

P: n/a
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

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.
>js*******@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 );

?>

What happens if you leave off the 0755? That may be restricted in your
location. Just try it with the default.

If it still doesn't work, looks like it's time to find another host. This one
has too many restrictions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Hmm, that's really crap. 755 does nothing more, and changing hosts
isn't really an option. ... :(

Frizzle.


But unfortunately, it looks like your host has too many things locked down for
you to be able to upload files through the website.

I can partially understand their reasoning in a shared environment. But at the
same time, other hosting companies can do it. So why can't they?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


I guess you're right, but i really really don't want to change hosts. I
have multiple
sites hosted there, knowing their service etc. is great. (And still is)
This is the
first kind of problem i've come across.

I mailed them with my problem, and saying i don't want to swich, and if
they can
come up with another solution. If not, then i'll see ...

I looked into another old site on one of their servers wich was meant
as an online
diary with a photo gallery. I created an upload-module for photos.
These were
automatically resized by PHP. Looking through Plesk's file manager, i
can see the
folder the pics end up in is chmodded rwx r-x r-x (755), pics are rw-
r-- r-- (644)

Pics and folder have the same owner, and belong to the same group. Pics
are as
i said PHP created, the folder was done in dreamweaver, but probably
chmodded
manually. I wonder if this is possible for other files then images,
because they
don't have to be resampled, so aren't actually created by PHP.

I hope you get what i'm saying.

Frizzle.

Apr 18 '06 #35

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
>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.
>>js*******@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 );
>
>?>
>
What happens if you leave off the 0755? That may be restricted in your
location. Just try it with the default.

If it still doesn't work, looks like it's time to find another host. This one
has too many restrictions.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Hmm, that's really crap. 755 does nothing more, and changing hosts
isn't really an option. ... :(

Frizzle.


But unfortunately, it looks like your host has too many things locked down for
you to be able to upload files through the website.

I can partially understand their reasoning in a shared environment. But at the
same time, other hosting companies can do it. So why can't they?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

I guess you're right, but i really really don't want to change hosts. I
have multiple
sites hosted there, knowing their service etc. is great. (And still is)
This is the
first kind of problem i've come across.

I mailed them with my problem, and saying i don't want to swich, and if
they can
come up with another solution. If not, then i'll see ...

I looked into another old site on one of their servers wich was meant
as an online
diary with a photo gallery. I created an upload-module for photos.
These were
automatically resized by PHP. Looking through Plesk's file manager, i
can see the
folder the pics end up in is chmodded rwx r-x r-x (755), pics are rw-
r-- r-- (644)

Pics and folder have the same owner, and belong to the same group. Pics
are as
i said PHP created, the folder was done in dreamweaver, but probably
chmodded
manually. I wonder if this is possible for other files then images,
because they
don't have to be resampled, so aren't actually created by PHP.

I hope you get what i'm saying.

Frizzle.


Yes, I see what you're saying. However, I don't think it should make a
difference like you think. Whether it's an image that's been sampled or a file
that's been uploaded, the Apache userid is doing the work.

The difference I can see is that the move_uploaded_files probably calls a system
function to actually move the files (don't know - I haven't looked). Obviously
the pix site doesn't do this when it resizes the pix; don't know what it does
before that, though.

the other possibility is they have the other server configured differently -
either PHP or the OS (or both). phpinfo() could tell you if there are PHP
differences.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 18 '06 #36

P: n/a
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:

Jerry Stuckle wrote:
>frizzle wrote:
>
>
>>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.
>>>js*******@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 );
>>
>>?>
>>
>What happens if you leave off the 0755? That may be restricted in your
>location. Just try it with the default.
>
>If it still doesn't work, looks like it's time to find another host. This one
>has too many restrictions.
>
>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
Hmm, that's really crap. 755 does nothing more, and changing hosts
isn't really an option. ... :(

Frizzle.
But unfortunately, it looks like your host has too many things locked down for
you to be able to upload files through the website.

I can partially understand their reasoning in a shared environment. But at the
same time, other hosting companies can do it. So why can't they?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

I guess you're right, but i really really don't want to change hosts. I
have multiple
sites hosted there, knowing their service etc. is great. (And still is)
This is the
first kind of problem i've come across.

I mailed them with my problem, and saying i don't want to swich, and if
they can
come up with another solution. If not, then i'll see ...

I looked into another old site on one of their servers wich was meant
as an online
diary with a photo gallery. I created an upload-module for photos.
These were
automatically resized by PHP. Looking through Plesk's file manager, i
can see the
folder the pics end up in is chmodded rwx r-x r-x (755), pics are rw-
r-- r-- (644)

Pics and folder have the same owner, and belong to the same group. Pics
are as
i said PHP created, the folder was done in dreamweaver, but probably
chmodded
manually. I wonder if this is possible for other files then images,
because they
don't have to be resampled, so aren't actually created by PHP.

I hope you get what i'm saying.

Frizzle.


Yes, I see what you're saying. However, I don't think it should make a
difference like you think. Whether it's an image that's been sampled or a file
that's been uploaded, the Apache userid is doing the work.

The difference I can see is that the move_uploaded_files probably calls a system
function to actually move the files (don't know - I haven't looked). Obviously
the pix site doesn't do this when it resizes the pix; don't know what it does
before that, though.

the other possibility is they have the other server configured differently -
either PHP or the OS (or both). phpinfo() could tell you if there are PHP
differences.

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


PHP & OS are similar.
My upload function is below.
Hope it can get me/you any further ...
(again, really thanks for all the help!!)

Frizzle.

******* C O D E - A L E R T ! ! ! ************************
<?php

function ResizeUpload( $this_uploaded_image )
{

global $album_id; // id of album where pic should end up in
global $conn_id;

$maxSize = 500;

$tmp_image = imagecreatefromjpeg($this_uploaded_image);
$width = imagesx($tmp_image);
$height = imagesy($tmp_image);

$maxSide = ( $width > $height ) ? $width : $height;

if ($maxSide > $maxSize)
{
$ratio = $maxSize / $maxSide;
$new_width = round( $width * $ratio, 0 );
$new_height = round( $height * $ratio, 0 );
}
else
{
$new_width = $width;
$new_height = $height;
};

$new_image = imagecreatetruecolor($new_width, $new_height);
imagecopyresized($new_image, $tmp_image, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);

//Grab new image
ob_start();
imagejpeg($new_image, '', 90);
$image_buffer = ob_get_contents();
ob_end_clean();
imagedestroy($new_image);

//Create temporary file and write to it
$fp = tmpfile();
fwrite($fp, $image_buffer);
rewind($fp);

$created = date("YmdHis");

$addpic = mysql_query("INSERT INTO photos (album_id) VALUES
($album_id)") or die(mysql_error());
$this_image_name= substr('0000000000'.mysql_insert_id(), -10, 10);

//Upload new image
if(ftp_fput($conn_id,'/httpdocs/img/photos/'.$this_image_name.'.jpg',
$fp, FTP_BINARY))
{

$_SESSION['UploadedPics'] += 1;

}
else
{

$error_reporting += 1;

};

fclose($fp);
};
$conn_id = ftp_connect('ftp.host.com');
ftp_login( $conn_id, 'loginname', 'pass')or die('Error :( ');

ResizeUpload($_FILES['image']['tmp_name'] );

ftp_close($conn_id);

?>

Apr 18 '06 #37

P: n/a
frizzle wrote:
<old posts snipped>


PHP & OS are similar.
My upload function is below.
Hope it can get me/you any further ...
(again, really thanks for all the help!!)

Frizzle.


<code snipped>

Sorry for the delay - I missed this one when you posted earlier in the week.

Well, it isn't how I would have done it, but it should work.

First thing I would have done was to move the uploaded file from the temp
directory a working directory (move_uploaded_file() ). This gets it completely
out of the temporary director (which could be something like /tmp) where there
may be limitations on what you can do with it.

Then I'd do the resizing or whatever I need in my workarea.

I'm also not sure why you're ftping back to yourself (at least I assume it's
yourself). Why not just store the file where you want it?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 23 '06 #38

P: n/a

Jerry Stuckle wrote:
frizzle wrote:
<old posts snipped>


PHP & OS are similar.
My upload function is below.
Hope it can get me/you any further ...
(again, really thanks for all the help!!)

Frizzle.


<code snipped>

Sorry for the delay - I missed this one when you posted earlier in the week.

Well, it isn't how I would have done it, but it should work.

First thing I would have done was to move the uploaded file from the temp
directory a working directory (move_uploaded_file() ). This gets it completely
out of the temporary director (which could be something like /tmp) where there
may be limitations on what you can do with it.

Then I'd do the resizing or whatever I need in my workarea.

I'm also not sure why you're ftping back to yourself (at least I assume it's
yourself). Why not just store the file where you want it?

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


No problem with the delay, i was only hoping your last message hadn't
been sent. And luckily it hasn't.

Erm, this is an adjusted script of something i found somewhere.
I wouldn't know how to store it where i want ... :$ Shame on me.
I only have relative little time during the weeks to dig into PHP :(
Is there something you could point to me ( a script, preferrably
w/o classes)?

Frizzle.

Apr 24 '06 #39

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
<old posts snipped>

PHP & OS are similar.
My upload function is below.
Hope it can get me/you any further ...
(again, really thanks for all the help!!)

Frizzle.


<code snipped>

Sorry for the delay - I missed this one when you posted earlier in the week.

Well, it isn't how I would have done it, but it should work.

First thing I would have done was to move the uploaded file from the temp
directory a working directory (move_uploaded_file() ). This gets it completely
out of the temporary director (which could be something like /tmp) where there
may be limitations on what you can do with it.

Then I'd do the resizing or whatever I need in my workarea.

I'm also not sure why you're ftping back to yourself (at least I assume it's
yourself). Why not just store the file where you want it?

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

No problem with the delay, i was only hoping your last message hadn't
been sent. And luckily it hasn't.

Erm, this is an adjusted script of something i found somewhere.
I wouldn't know how to store it where i want ... :$ Shame on me.
I only have relative little time during the weeks to dig into PHP :(
Is there something you could point to me ( a script, preferrably
w/o classes)?

Frizzle.


Not really. When I need something like this I just code it up. But they're
typically special purpose and would need changing for your system.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 24 '06 #40

P: n/a
> 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.


Which may be your userid, which may be the userid you use for ftp.

Apr 24 '06 #41

P: n/a

Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
<old posts snipped>
PHP & OS are similar.
My upload function is below.
Hope it can get me/you any further ...
(again, really thanks for all the help!!)

Frizzle.
<code snipped>

Sorry for the delay - I missed this one when you posted earlier in the week.

Well, it isn't how I would have done it, but it should work.

First thing I would have done was to move the uploaded file from the temp
directory a working directory (move_uploaded_file() ). This gets it completely
out of the temporary director (which could be something like /tmp) where there
may be limitations on what you can do with it.

Then I'd do the resizing or whatever I need in my workarea.

I'm also not sure why you're ftping back to yourself (at least I assume it's
yourself). Why not just store the file where you want it?

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

No problem with the delay, i was only hoping your last message hadn't
been sent. And luckily it hasn't.

Erm, this is an adjusted script of something i found somewhere.
I wouldn't know how to store it where i want ... :$ Shame on me.
I only have relative little time during the weeks to dig into PHP :(
Is there something you could point to me ( a script, preferrably
w/o classes)?

Frizzle.


Not really. When I need something like this I just code it up. But they're
typically special purpose and would need changing for your system.

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


Jerry, is there any possiblity for you e.g. to point me in a certain
direction? As you
said, you would've done it differently ...

Frizzle.

Apr 24 '06 #42

P: n/a
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
Jerry Stuckle wrote:
frizzle wrote:
<old posts snipped>

>PHP & OS are similar.
>My upload function is below.
>Hope it can get me/you any further ...
>(again, really thanks for all the help!!)
>
>Frizzle.
>

<code snipped>

Sorry for the delay - I missed this one when you posted earlier in the week.

Well, it isn't how I would have done it, but it should work.

First thing I would have done was to move the uploaded file from the temp
directory a working directory (move_uploaded_file() ). This gets it completely
out of the temporary director (which could be something like /tmp) where there
may be limitations on what you can do with it.

Then I'd do the resizing or whatever I need in my workarea.

I'm also not sure why you're ftping back to yourself (at least I assume it's
yourself). Why not just store the file where you want it?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
No problem with the delay, i was only hoping your last message hadn't
been sent. And luckily it hasn't.

Erm, this is an adjusted script of something i found somewhere.
I wouldn't know how to store it where i want ... :$ Shame on me.
I only have relative little time during the weeks to dig into PHP :(
Is there something you could point to me ( a script, preferrably
w/o classes)?

Frizzle.


Not really. When I need something like this I just code it up. But they're
typically special purpose and would need changing for your system.

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

Jerry, is there any possiblity for you e.g. to point me in a certain
direction? As you
said, you would've done it differently ...

Frizzle.


Yes, to start I'd move it from the temporary directory with
move_uploaded_file(). Then I'd do my work on it and write it directly to the
filesystem with the file functions such as fopen(), etc.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 24 '06 #43

P: n/a
fletch wrote:
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.

Which may be your userid, which may be the userid you use for ftp.


In that case the PHP application didn't create it. FTP did. It may have been
driven by the PHP application, but it's not the application working directly on
the filesystem.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 24 '06 #44

P: n/a
>> Which may be your userid, which may be the userid you use for ftp.

In that case the PHP application didn't create it. FTP did. It may have been
driven by the PHP application, but it's not the application working directly on
the filesystem.
I should be clearer. Apache can run with suExec, and often does in a
shared hosting environment. This means that the particular apache
process which runs a script runs with the uid and gid of that script.
The host will then ensure that the files in the user's directory have
the correct uid and gid bits set. This means that the uid of an ftp'd
file and a file created by php run through apache will be the same.

Just a foot note to the main point of the thread.
From http://httpd.apache.org/docs/1.3/suexec.html The suEXEC feature -- introduced in Apache 1.2 -- provides Apache users the ability to run CGI and
SSI programs under user IDs different from the user ID of the calling web-server. Normally, when a
CGI or SSI program executes, it runs as the same user who is running the web server.

Used properly, this feature can reduce considerably the security risks involved with allowing users
to develop and run private CGI or SSI programs. However, if suEXEC is improperly configured, it
can cause any number of problems and possibly create new holes in your computer's security. If
you aren't familiar with managing setuid root programs and the security issues they present, we
highly recommend that you not consider using suEXEC.


Apr 24 '06 #45

P: n/a
fletch wrote:
Which may be your userid, which may be the userid you use for ftp.


In that case the PHP application didn't create it. FTP did. It may have been
driven by the PHP application, but it's not the application working directly on
the filesystem.

I should be clearer. Apache can run with suExec, and often does in a
shared hosting environment. This means that the particular apache
process which runs a script runs with the uid and gid of that script.
The host will then ensure that the files in the user's directory have
the correct uid and gid bits set. This means that the uid of an ftp'd
file and a file created by php run through apache will be the same.

Just a foot note to the main point of the thread.
From http://httpd.apache.org/docs/1.3/suexec.html


The suEXEC feature -- introduced in Apache 1.2 -- provides Apache users the ability to run CGI and
SSI programs under user IDs different from the user ID of the calling web-server. Normally, when a
CGI or SSI program executes, it runs as the same user who is running the web server.

Used properly, this feature can reduce considerably the security risks involved with allowing users
to develop and run private CGI or SSI programs. However, if suEXEC is improperly configured, it
can cause any number of problems and possibly create new holes in your computer's security. If
you aren't familiar with managing setuid root programs and the security issues they present, we
highly recommend that you not consider using suEXEC.



Thanks for the info, Fletch. I knew there was something different about SuEXEC,
but wasn't sure what it was.

So he may need to either chown the scripts to the Apache process owner, or
create the directories with the same owner as the script?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 24 '06 #46

P: n/a
> So he may need to either chown the scripts to the Apache process owner, or
create the directories with the same owner as the script?


I think so yes.

Apr 25 '06 #47

P: n/a
fletch wrote:
So he may need to either chown the scripts to the Apache process owner, or
create the directories with the same owner as the script?

I think so yes.


OK, that makes sense then. Thanks again for the info!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 25 '06 #48

This discussion thread is closed

Replies have been disabled for this discussion.