Home Backend Development PHP Tutorial 用php控制ftp上传文件有关问题已经简化成最简单的代码了 为什么还是有异常呢?

用php控制ftp上传文件有关问题已经简化成最简单的代码了 为什么还是有异常呢?

Jun 13, 2016 pm 01:39 PM
AAA file ftp put

用php控制ftp上传文件问题已经简化成最简单的代码了 为什么还是有错误呢???
$file = 'aaa.txt';//根目录下的文件
$remote_file = 'aaa1.txt';//远程文件

$conn_id = ftp_connect($server);

$login_result = ftp_login($conn_id,$username,$password);

ftp_pasv($conn_id, true);

if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY,0)) {
echo "successfully uploaded $file\n";

else {
echo "There was a problem while uploading $file\n";
}

ftp_close($conn_id);

  //错误信息:Warning: ftp_put() [function.ftp-put]: aaa.txt: Access is denied. in D:\Program Files\appserv\www\wx\ftp.php on line 63
There was a problem while uploading aaa.txt

------解决方案--------------------
Access is denied
访问被拒绝。

------解决方案--------------------
aaa.txt 改改这个文件的权限。使之可读、可写、可......
------解决方案--------------------
ftp_put 有同名覆盖的功能吗? 映像中没有
------解决方案--------------------
Warning: ftp_put() [function.ftp-put]: aaa.txt: Access is denied. 权限问题
------解决方案--------------------
很明显,木有参加人大代表发言的权利

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hongmeng native application random poetry Hongmeng native application random poetry Feb 19, 2024 pm 01:36 PM

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

How to set up nginx reverse proxy ftp server How to set up nginx reverse proxy ftp server May 17, 2023 am 09:31 AM

1. Install nginx 2. Install vsftpd 3. Modify the nginx configuration file nginx.conf 3.1 Add the ftp user userftpuser in the first line; 3.2 Configure the relevant path server{ listen80; #nginx proxy port server_namelocalhost; #ftp server address location/images{root /home/ftpuser; #The absolute path of the folder of the proxy ftp server indexftpuser; #Set the welcome page

Use java's File.length() function to get the size of the file Use java's File.length() function to get the size of the file Jul 24, 2023 am 08:36 AM

Use Java's File.length() function to get the size of a file. File size is a very common requirement when dealing with file operations. Java provides a very convenient way to get the size of a file, that is, using the length() method of the File class. . This article will introduce how to use this method to get the size of a file and give corresponding code examples. First, we need to create a File object to represent the file we want to get the size of. Here is how to create a File object: Filef

Using FTP in Go: A Complete Guide Using FTP in Go: A Complete Guide Jun 17, 2023 pm 06:31 PM

With the rapid development of the Internet, File Transfer Protocol (FTP) has always been an important file transfer method. In Go language, using FTP to transfer files may be a need of many developers. However, maybe many people don't know how to use FTP in Go language. In this article, we will explore how to use FTP in Go language, from connecting to FTP server to file transfer, and how to handle errors and exceptions. Create FTP connection In Go language, we can use the standard "net" package to connect to FTP

What are the ftp commands under linux? What are the ftp commands under linux? Mar 21, 2023 am 09:59 AM

The ftp commands under Linux include: 1. ftp command; 2. close command; 3. disconnect command; 4. open command; 5. user command; 6. account command; 7. bye command; 8. quit command; 9. help command ;10. rhelp command; 11. ascii command; 12. binary/bi command; 13. bell command, etc.

Rename files using java's File.renameTo() function Rename files using java's File.renameTo() function Jul 25, 2023 pm 03:45 PM

Use Java's File.renameTo() function to rename files. In Java programming, we often need to rename files. Java provides the File class to handle file operations, and its renameTo() function can easily rename files. This article will introduce how to use Java's File.renameTo() function to rename files and provide corresponding code examples. The File.renameTo() function is a method of the File class.

PHP and FTP: realizing file sharing among multiple departments in website development PHP and FTP: realizing file sharing among multiple departments in website development Jul 28, 2023 pm 01:01 PM

PHP and FTP: Achieve file sharing among multiple departments in website development. With the development of the Internet, more and more companies are beginning to use website platforms for information release and business promotion. However, the problem that arises is how to achieve file sharing and collaboration among multiple departments. In this case, PHP and FTP become one of the most commonly used solutions. This article will introduce how to use PHP and FTP to achieve file sharing among multiple departments in website development. 1. Introduction to FTP FTP (FileTransferPr

How to use FTP to upload files in Python How to use FTP to upload files in Python Apr 29, 2023 am 09:49 AM

Introduction to FTP FTP is File Transfer Protocol (FileTransferProtocol), which is a standard protocol for file transfer on the network. FTP client can upload files from local to server or download from server to local. The ftplib module Python provides a standard library ftplib for implementing FTP client functions in Python. Using ftplib, we can connect to the FTP server and perform various FTP operations, such as uploading and downloading files, etc. Code explanation The following is a sample code for uploading files through FTP using Python: fromftplibimportFTPimportargparsed

See all articles