Re: [PHP] File Copy

2004-10-20 Thread Aidal
ERR, I meant I tried ftp_exec(), ftp_raw() is a PHP 5 function too...

"Aidal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ftp_chmod() is part of PHP 5 and I'm working with PHP 4.3.1.
>
> I tried the ftp_raw('CHMOD 777 filename.jpg'); doesn't work either though
:(
>
> "Silvio Porcellana" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Aidal wrote:
> > > Hi NG.
> > >
> > > I'm experiencing some problems when trying to copy a file from one
> location
> > > to another on the web server.
> > >
> > > example:
> > >
> > > dir1/subdir1/some_image_name.jpg  -->
> dir2/subdir2/some_new_image_name.jpg
> > >
> > > When I do this the file permissions changes and I'm no longer the
owner
> of
> > > the file. I tried to use chmod('the_new_file', 0777); but it doesn't
> work,
> > > because chmod() wont let me change the permissions since I'm not the
> owner
> > > of this new file.
> > >
> > The owner should now be the user the Web server is running as.
> > To change file ownerships you need to use the PHP FTP functions.
> > Check out these pages: http://php.libero.it/manual/en/ref.ftp.php
> >
> > HTH, cheers!
> > Silvio Porcellana

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Copy

2004-10-20 Thread Aidal
ftp_chmod() is part of PHP 5 and I'm working with PHP 4.3.1.

I tried the ftp_raw('CHMOD 777 filename.jpg'); doesn't work either though :(

"Silvio Porcellana" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Aidal wrote:
> > Hi NG.
> >
> > I'm experiencing some problems when trying to copy a file from one
location
> > to another on the web server.
> >
> > example:
> >
> > dir1/subdir1/some_image_name.jpg  -->
dir2/subdir2/some_new_image_name.jpg
> >
> > When I do this the file permissions changes and I'm no longer the owner
of
> > the file. I tried to use chmod('the_new_file', 0777); but it doesn't
work,
> > because chmod() wont let me change the permissions since I'm not the
owner
> > of this new file.
> >
> The owner should now be the user the Web server is running as.
> To change file ownerships you need to use the PHP FTP functions.
> Check out these pages: http://php.libero.it/manual/en/ref.ftp.php
>
> HTH, cheers!
> Silvio Porcellana

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] File Copy

2004-10-20 Thread Aidal
Hi NG.

I'm experiencing some problems when trying to copy a file from one location
to another on the web server.

example:

dir1/subdir1/some_image_name.jpg  -->  dir2/subdir2/some_new_image_name.jpg

When I do this the file permissions changes and I'm no longer the owner of
the file. I tried to use chmod('the_new_file', 0777); but it doesn't work,
because chmod() wont let me change the permissions since I'm not the owner
of this new file.

The server runs on some kind of UNIX based system...

Any help or suggestions would be much appreciated, thanks.

/Aidal

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to create files??

2002-10-10 Thread Aidal

I'm using the following function to create the files. the function is part
of a class so "$this->somthing" refers to somthing in that class:

function create_file($file_name) {
if (!$this->fp = fopen($file_name, wb)) {
$this->error_msg .= $this->error_create . ' ' . $file_name;
return false;
} else {
$this->file = $file_name;
return $this->fp;
}
}

Also the script using this class is in the http-server-root and includes
this class. the include file isn't in the http-server-root, but that
shouldn't have any effect since it's not the include file that calls to
function.

The calling script: http-server-root
The include class: http-server-root\nef
Where I want to create files: http-server-root\nef\articles

Hope this gave you a better chance of helping me out :)

~ Aidal


"Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
006b01c26f7a$28ffa110$0500a8c0@BAMBINO">news:006b01c26f7a$28ffa110$0500a8c0@BAMBINO...
> If the script is in the same directory just try either "{file}" nothing
> in front or "./{file}"
>
> What function are you using to create files?
>
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -Original Message-
> From: Aidal [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 9 October 2002 4:24 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how to create files??
>
>
> Hi NG.
>
> I'm having problems creating files at a certain location.
> If I attemt to create a file it gets created in the rootdir (htdocs)
> even though I add a path infront of the file name. I've tried severel
> ways of adding a path (with "/" and "\\") but nothing works.
>
> eksample: "/nef/articles/54.txt"
>
> File 54.txt gets created but not at the intented location, instead it
> gets created in htdocs.
>
> Can anyone help me by telling me how I'm suppose to do this? I'm running
> PHP on Win98 with Apache.
>
> ~ Aidal
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] how to create files??

2002-10-09 Thread Aidal

Hi NG.

I'm having problems creating files at a certain location.
If I attemt to create a file it gets created in the rootdir (htdocs) even
though I add a path infront of the file name. I've tried severel ways of
adding a path (with "/" and "\\") but nothing works.

eksample: "/nef/articles/54.txt"

File 54.txt gets created but not at the intented location, instead it gets
created in htdocs.

Can anyone help me by telling me how I'm suppose to do this?
I'm running PHP on Win98 with Apache.

~ Aidal



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php