ftp-upload+prohibited file name

Just clear it to me:

I cant able to upload a file.In ftp_put() iam getting the error.My exact error is following.

Connected to anwsi.com, for user anwsi
Warning: ftp_put(): Prohibited file name: /public_html/angel/ in /home/anwsi/public_html/angel/fupload.php on line 29
There was a problem while uploading .

My html form:








My php form:
$source_file=$_REQUEST["file"];
$destination_file="/public_html/angel/";

// upload a file
if (ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY)) {
echo "successfully uploaded $source_file
";
} else {
echo "There was a problem while uploading $source_file
";
}


Comments

  • My guess is it's the leading '/' in your destination path. In Linux, a '/' at the start of the path implies that you're specifying a fully-qualified path off the root directory. That is, you're trying to put your file in /public_html/angel, when you actually mean to put your file in /home/anwsi/public_html/angel.

    Try this..

    [code]
    $source_file=$_REQUEST["file"];
    $destination_file="/home/anwsi/public_html/angel/";
    [/code]

    You also have the option of dropping off the leading '/', in which case you're specifying a path relative to the current directory, but I don't know what directory your script's called off of so I can't help there :)

    Hope this provides some insight.. Let me know how it works out for you.

    T

    : Just clear it to me:
    :
    : I cant able to upload a file.In ftp_put() iam getting the error.My exact error is following.
    :
    : Connected to anwsi.com, for user anwsi
    : Warning: ftp_put(): Prohibited file name: /public_html/angel/ in /home/anwsi/public_html/angel/fupload.php on line 29
    : There was a problem while uploading .
    :
    : My html form:
    :
    :
    :
    :


    :
    :
    :
    : My php form:
    : $source_file=$_REQUEST["file"];
    : $destination_file="/public_html/angel/";
    :
    : // upload a file
    : if (ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY)) {
    : echo "successfully uploaded $source_file
    ";
    : } else {
    : echo "There was a problem while uploading $source_file
    ";
    : }
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion