chttp上传下载
❶ linux安装的一个软件可以http上传下载文件,带web管理端。不知道叫啥名或者类似功能的软件
nginx服务器实现上传下载文件
下载
更新配制文件,添加如下字段,这里用alias实现把嵌入式开发板的根目录全部映射过去,
location /download {
alias /;
autoindex on;
autoindex_localtime on;
autoindex_exact_size off;
}
执行,
$ ./nginx/sbin/nginx -p ./nginx -s reload
上传
需要有nginx的源码,重新编译nginx,添加上传模块,上传进度模块,《Linux就该这么学》更多知识,一起学习交流。
$ ./configure --add-mole=$parent_path/nginx-upload-mole-2.3.0 --add-mole=$parent_path/nginx-upload-progress-mole-0.8.4
$ make
$ make install
添加配置文件,
location /upload {
upload_pass /;
# upload_cleanup 400 404 499 500-505;
upload_store /boot;
upload_store_access user:rw;
# upload_limit_rate 128k;
upload_set_form_field "${upload_field_name}_name" $upload_file_name;
upload_set_form_field "${upload_field_name}_content_type" $upload_content_type;
upload_set_form_field "${upload_field_name}_path" $upload_tmp_path;
upload_aggregate_form_field "${upload_field_name}_md5" $upload_file_md5;
upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size;
upload_pass_form_field "^.*$";
}