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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Dec 22 10:01:28 2024 UTC