0

I'm trying to access a URL like: ftp.somesite.com/content/somefile.txt

Using login myname and pass mypass.

I can enter these in IE9 when they are requested and it opens the file right up. However, when I try this in PHP or Firefox I'm given a 550 error regarding the file /myname/content/somefile.txt.

What is wrong and why are both PHP and Firefox changing the file location to include myname as part of the file path?

4

3 に答える 3

0

ftp:// username:password@ftp.somesite.com/content/somefile.txt

これは有効なURLです。FTPクライアントは、ログイン時にユーザー名@ホスト名をURLに挿入する場合があります。これは問題ではありません。わかりやすくするためであり、そのURLをユーザー名でコピーして貼り付けることもできます。

于 2012-06-07T15:24:58.737 に答える
0

PHPとFirefoxの両方でこれを解決する方法を理解しました。

ディレクトリ構造にユーザー名が追加されないようにするには、ファイルパスの先頭に別の「/」を追加します。これにより、ルートディレクトリが強制されます。

言い換えると:

ftp.somesite.com//content/somefile.txt

于 2012-06-07T16:00:11.903 に答える
0

When you log into FTP, your base directory may not be the same as your htdoc/web server directory.

What is the full file path for the file you wish to download?

Ex:

/root/somefile.txt
/home/user/test/somefile.txt
/var/www/site/content/somefile.txt
于 2012-06-07T15:41:30.697 に答える