让nginx支持文件上传的几种模式
发布日期:2021-05-09 18:12:38 浏览次数:8 分类:精选文章

本文共 3149 字,大约阅读时间需要 10 分钟。

������������������������������������

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������


PHP ������������������

PHP ������������������������������������������������������ task���������������������������������������������������������

  • ��������������������� $_FILES ���������������������������������������������������������������������������������������������
  • ���������������������������������������������������������������������������������������������
  • ������������������������������������������������������������������������������������������
  • ��������������� PHP ���������������������

    0) {
    echo "������������������";
    }
    ?>

    ������ curl ������������������������������ PHP ������������������������������

    curl -F "action=file.php" -F "file=@xxx.c" http://192.168.1.162/file.php

    Lua ������������������������

    ��������������������������������������������������������������� Lua ������������ Nginx ��� nginx_lua ��������������������������������������������� RESTful API ������������������

  • ��������������������������������� ngx_openresty ������������
  • ��������������������� resty-upload ��������������������������������������������������������� savefile.lua ���������������������
  • ������������������������ Lua ���������������������

    package.path = '/usr/local/share/lua/5.1/?.lua;/usr/local/openresty/lualib/resty/?.lua';
    package.cpath = '/usr/local/lib/lua/5.1/?.so';
    local upload = require "upload"
    local chunk_size = 4096
    local form = upload:new(chunk_size)
    local file
    local filelen = 0
    form:set_timeout(0) -- ���������������������������������

    Perl ������������������������

    Perl ���������������������������������������������������������������������������Per Never solution ������������������������������������

  • ��������������������������� WWW::Curl::Easy ��� HTTP::Request ���������
  • ��������������������� PHP ���������������������������������������������������������
  • ������������������������ Perl ���������������

    use strict;
    use warnings;
    use WWW::Curl::Easy;
    use HTTP::Request;
    my $curl = WWW::Curl::Easy->new();
    # ������������������
    my $form = HTTP::Request->new();
    $form->method("POST");
    $form->uri("http://127.0.0.1/upload");

    Nginx DAV ��������� PUT ������

    Nginx ��� DAV ������������ RESTful ��������������������������������������� PUT ���������������������������������������������������������������

  • ������ Nginx��������������������� --with-http_dav_module ���������
  • ������������������ nginx.conf ������������������������������������
  • location / {
    client_body_temp_path /usr/local/nginx/html/tmp;
    dav_methods PUT DELETE MKCOL COPY MOVE;
    create_full_put_path on;
    dav_access group:rw all:r;
    root html;
    }

    ������������������������������

  • ������������������������PHP ��� Lua ������������
  • ���������������������������������Dav ������������������������������������������
  • ���������������������Perl ������������������������������
  • ���������������������������������������������������������������������������������������������

    上一篇:openwrt开启Samba作为共享中心 win7如何访问linux samba服务器
    下一篇:linux 容器(LXC) 第1章 LXC 简介

    发表评论

    最新留言

    路过按个爪印,很不错,赞一个!
    [***.219.124.196]2025年04月19日 04时58分31秒