php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #588 fopen wraper can not open file on ftp:// for writing
Submitted: 1998-07-28 08:24 UTC Modified: 1998-08-06 12:18 UTC
From: dzoni at eunet dot yu Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.2a OS: Linux 2.0.34
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dzoni at eunet dot yu
New email:
PHP Version: OS:

 

 [1998-07-28 08:24 UTC] dzoni at eunet dot yu
fopen wrappers can not open file on ftp site in write mode,
e.g. I can not use it to _upload_ file to server.

Sample code:

$f=fopen("ftp://dzoni:xxx@yyy.eunet.yu/tmp/test.txt","w");
if ($f){
        fputs ($f,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
 	fclose ($f);
} else {
	echo "cann't upload file";
}

If the file /tmp/test.txt doesn't exist I get:
<b>Warning</b>:  fopen("ftp://dzoni:***@yyy.eunet.yu/tmp/test.txt","w") - Not a directory in <b>test.phtml</b> on line <b>5</b><br> 

If the file exists and I can write to file (e.g it's mode 666), I
get no warning message, but content's of file are not
changed.

I can read files on ftp fine, I would just like to be
able to upload them this way, and in docs it is't mentioned
that this can not be done.

Put it on a wish list if you don't consider it a bug.

Regards,
Nikola Kljukovnica

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-06 12:18 UTC] rasmus
ftp support includes sending of files as of 3.0.3
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 14:01:30 2024 UTC