PHP ftp_alloc() လုပ်ဆောင်ချက်
ဥပမာ
ဖိုင်တစ်ခုအတွက် နေရာခွဲဝေပေးပြီး ဖိုင်ကို FTP ဆာဗာသို့ အပ်လုဒ်လုပ်ပါ-
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
$file = "/test/myfile";
// allocate space
if (ftp_alloc($ftp_conn, filesize($file), $result))
{
echo "Space allocated on server. Sending $file.";
ftp_put($ftp_conn, "/files/myfile", $file, FTP_BINARY);
}
else
{
echo "Error! Server said: $result";
}
// close connection
ftp_close($ftp_conn);
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ftp_alloc() လုပ်ဆောင်ချက်သည် FTP ဆာဗာသို့ ဖိုင်တစ်ခုကို အပ်လုဒ်တင်ရန် နေရာခွဲဝေပေးသည်။
မှတ်ချက်- FTP ဆာဗာများစွာသည် ဤအမိန့်ကို မပံ့ပိုးပါ။
အထားအသို
ftp_alloc(ftp_conn, filesize, result);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
filesize | Required. Specifies the number of bytes to allocate |
result | Optional. Specifies a variable to store the server response in |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုအပေါ် သစ္စာ၊ ကျရှုံးမှုတွင် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | ၅+ |
❮ PHP FTP အကိုးအကား