[PHP] ftp in PHP4

2001-09-17 Thread Chesley A Windon

I need to have web based ftp capabilities for a site I am working on.  My 
development server is running RedHat 7.1 and php-4.0.4, and I did compile 
php with the --enable-ftp switch.

After reading the docs at php.net, I found a "canned" script 
(http://www.php.net/manual/en/ref.ftp.php) that I thought I would try so 
as to give me a better idea on what was involved.

When running the script, I can connect to the ftp server, list the 
contents of the directory, and disconnect, but cannot upload anything.  
When I try, I get the following error:

Warning: error opening /home/windon/somefile in 
/var/www/html/ftp.php on line 43

line 43 reads:

$upload = ftp_put($conn_id, "$destination_file", "$source_file", 
FTP_BINARY);

In $destination_file I have just the filename, while in $source_file I 
have the full path and the filename.

Thanks,

Chesley


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: ftp in PHP4

2001-09-22 Thread Chesley A. Windon

Since my original post, the status has changed but let me recap...

The file /home/windon/somefile did have permissions set to have anyone
read it, but I never checked the permissions on the /home/windon
directory.  This has since been corrected.

Next I was getting a permission denied error, which I found to be on the
destination host.  I had to give permissions of 777 to the destination
directory for file transfer to happen.  I find this as a security issue.

Has anyone experienced this, or know of a work around?

Thanks again,

Chesley

> Does the PHP user (nobody) have read access to the local file you are
trying
> to upload?
> Are you 100% sure you have the right things in the filenames?...  Print them
> out right before the ftp_puts line.
>
> > I need to have web based ftp capabilities for a site I am working on.  My
> > development server is running RedHat 7.1 and php-4.0.4, and I did compile
> > php with the --enable-ftp switch.
> >
> > After reading the docs at php.net, I found a "canned" script
> > (http://www.php.net/manual/en/ref.ftp.php) that I thought I would try so
> > as to give me a better idea on what was involved.
> >
> > When running the script, I can connect to the ftp server, list the
> > contents of the directory, and disconnect, but cannot upload anything.
> > When I try, I get the following error:
> >
> > Warning: error opening /home/windon/somefile in
> > /var/www/html/ftp.php on line 43
> >
> > line 43 reads:
> >
> > $upload = ftp_put($conn_id, "$destination_file", "$source_file",
> > FTP_BINARY);
> >
> > In $destination_file I have just the filename, while in $source_file I
> > have the full path and the filename.
> >
> > Thanks,
> >
> > Chesley
> >
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] FTP

2001-10-02 Thread Chesley A Windon

> I'm trying to upload some files using PHP, but I'm limited to small files of 1Mb or 
>a little more and I don't know why. Could anyone please help me with this? 
> 
>  This is the message I get:
> Warning: error opening none in /home/proj/sapens/public_html/f1_material.php on line 
>51


By default php limits file uploads to 2MB.  You need to change the 
upload_max_filesize variable in your php.ini.

Chesley


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]