我可以使用 force_download() 定义下载到的文件夹吗?
Can I define a folder where to download to, using force_download()?
我需要定义一个存放下载文件的文件夹。
是否可以使用 Codeigniter 框架的 force_download()
功能实现下载到特定文件夹?
force_download()
是 CI download helper
的一部分
Generates server headers which force data to be downloaded to your
desktop. Useful with file downloads. The first parameter is the name
you want the downloaded file to be named, the second parameter is the
file data.
就是说,一个文件将被下载到您指定的下载文件夹中,无论它在您本地磁盘上的哪个位置。您可以使用这种方法让任何用户都可以下载文件
您正在寻找的是使用 CI FTP Class:
Downloads a file from your server. You must supply the remote path and
the local path, and you can optionally set the mode. Example:
$this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii');
您必须确保每次调用此方法时用户都为您提供有效的本地路径,下载的文件将存储在该路径中。
我需要定义一个存放下载文件的文件夹。
是否可以使用 Codeigniter 框架的 force_download()
功能实现下载到特定文件夹?
force_download()
是 CI download helper
Generates server headers which force data to be downloaded to your desktop. Useful with file downloads. The first parameter is the name you want the downloaded file to be named, the second parameter is the file data.
就是说,一个文件将被下载到您指定的下载文件夹中,无论它在您本地磁盘上的哪个位置。您可以使用这种方法让任何用户都可以下载文件
您正在寻找的是使用 CI FTP Class:
Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. Example:
$this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii');
您必须确保每次调用此方法时用户都为您提供有效的本地路径,下载的文件将存储在该路径中。