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 "^.*$";
}