Configure WebDAV server in OS X 10.9 federated Nsurlsessionuploadtask implementation file upload

Source: Internet
Author: User
Tags exit file upload

IOS7 's nsurlsession simplifies nsurlconnection file uploads and downloads, and this article records how to configure the WebDAV service to support put-style file uploads.

I. Configuring a WebDAV Server

1. Modify Httpd.conf

1> Open the terminal, and then enter:

cd/etc/apache2/

sudo vi httpd.conf

2> Input in VI

/httpd-dav.conf

Find httpd-dav.conf

3> the line's first # comment Delete

4> Save and exit

Input

: Wq

2. Modify Httpd-dav.conf

1> is entered in the terminal:

Cd/etc/apache2/extra

sudo vi httpd-dav.conf

2> Modify the contents of the httpd-dav.conf according to the following content

Hint: Only the authorization type and user password files have been modified two locations

Davlockdb "/usr/var/davlock"
    
alias/uploads "/usr/uploads"
    
<directory "/usr/uploads" >
    Dav
    
    on Order Allow,deny
    Allow from all
    
    #用户的授权类型
    authtype Basic
    authname dav-upload
    
    # and can use the Htdigest to create the password database:
    #   Htdigest-c "/usr/user.passwd" dav-upload admin
    # User Password File
    authuserfile "/usr/webdav.passwd"
    authdigestprovider file
    
    # Allow Universal read-access, but writes are restricted
    <limitexcept get options>
        require user admin
    </LimitExcept>
</ Directory>

Description

According to the above configuration file, you can upload the file to the/usr/uploads directory via url->http://localhost/uploads

The user name used to upload the file is: admin

3> Save and exit

Input

: Wq

3. Create folders and configure files

1> Create the admin password and enter it in the terminal:

sudo htpasswd-c/usr/webdav.passwd admin

Then enter the admin password, the password file will be saved in the/USR/WEBDAV.PASSWD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.