1
应用程序的文件上传/下载部分受密码保护,因此只有管理员可以上传,查看和下载文件。但他们不能驻留在public_html内,因为他们包含个人信息,不能在未登录的情况下访问。jquery-file-upload插件 - 如何更改public_html下面/外部的上传路径?
我能够更改上传文件夹 - 但它看起来必须在public_html中,否则你不能查看你的上传,你不能下载它们。
这适用于web public_html目录内的“正常”操作 - 但如何将'upload_url'=> HTTP_SERVER设置为public_html之外?似乎必须有一些路径翻译,所以file_upload应用程序可以提供一个下载链接,也许缓冲读取输出用户的浏览器?
<?php
// index.php
/*
* jQuery File Upload Plugin PHP Example
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
// using jQuery-File-Upload version: 9.12.5
error_reporting(E_ALL | E_STRICT);
// UploadHandler.php and index.php remain in the default location
// jQuery-File-Upload_root/server/php/
require('UploadHandler.php');
define('DIR_DOWNLOAD', '../../_uploads/'); // the directory is in jQuery-File-Upload_root/_uploads
define('HTTP_SERVER', 'http://localhost/jQuery-File-Upload-9.12.5/_uploads/');
$upload_handler = new UploadHandler(
array(
'upload_dir' => DIR_DOWNLOAD,
'upload_url' => HTTP_SERVER,
)
);