Home
english
Home
.NET Server
Java Server
.NET Client
AJAX Client
AJAX Browser
Map Drive
Pricing
Contacts
info@ithit.com



Uploading Files to WebDAV Server in AJAX Application

Due to modern browsers limitations there is no way to upload a file from local file system to WebDAV server using PUT verb as WebDAV specification requires. This article describes how to upload a file to IT Hit WebDAV Server engine using POST request.

Uploading using POST Multipart Request

While most WebDAV client upload files using PUT verb, AJAX/HTML applications are unable to submit a file using PUT. However the IT Hit WebDAV Server Engine can process files submitted with POST multipart request. The following example uploads a file to /mydocs folder:

<html>

    <head><title>POST Upload to WebDAV Server</title></head>

    <body>

        <form action="/mydocs/" method="post" enctype="multipart/form-data">

            <input type="file" name="dummyname" /><br />

            <input type="submit" />

        </form>

    </body>

</html>

When creating a multipart POST form make sure you follow this rules:

  1. Specify enctype="multipart/form-data" attribute on a form tag.
  2. Add name attribute to a single input type=file tag.
  3. DO NOT add name attribute to any other input, select, textarea tags.

Always submit only one file per form. The server will be unable to calculate file size correctly if any extra input/select/textarea values submitted due to POST request standard limitations.

Action attribute can specify a folder or a file url. If the file with such name does not exist it will be created. If the file already exists it will be overwritten.

Note that maximum file upload size in most browsers is 2Gb.


What WebDAV software would you like to have?

Selected Customers:
Country: Norway
DnB NOR Group
Country: Finland
Bank of Finland
Country: United Kingdom
Bechtle Direct
Country: Sweden
BT Industries
Country: USA
California Chamber of Commerce
Country: Denmark
Danfoss Group
Country: Denmark
DFDS
Country: USA
Fluke Networks
Country: USA
HNI Corporation
Country: USA
IHS Inc
Country: USA
LandAmerica Financial Group
Country: Canada
Laurentian University
Country: USA
Microsoft
Country: Israel
RADVISION
Country: Ukraine
Raiffeisen Bank
Country: Netherlands
Sanoma Uitgevers
Country: USA
Siemens
Country: Australia
WorkCover NSW
Country: Ukraine
OTP Bank
Country: USA
Intel Corporation
Country: Austria
Austrian Federal Railways
Home .NET Server Java Server .NET Client AJAX Client AJAX Browser Map Drive Pricing Contacts

Updated: Friday, November 28, 2008