note 47014 added to function.fopen
| From: | info at gavinvincent dot co dot uk | Date: | Sat, 30 Oct 2004 16:00:52 +0000 |
| Subject: | note 47014 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79366@lists.php.net to get a copy of this message | ||
One that caught me out was when trying to open/create a remote file using:
<?
fopen("ftp://user:password@example.com/foo/bar.jpg","w");
?>
to create a file bar.jpg in the directory foo, I kept getting errors saying the directory does not
exist. This is because the root is the ftp root, not the ordinary server root. So it should be:
<?
fopen("ftp://user:password@example.com/public_html/foo/bar.jpg","w");
?>
or htdocs, www, or wherever your documents are.
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47014
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47014&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47014&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47014&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47014&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47014&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47014&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47014&report=yes
Search -- http://master.php.net/manage/user-notes.php