Drag & Drop . v5.3

Real drag-and-drop demos - including folder drops and the cross-tab dashboard.

Every link below is a working <au:AjaxFileUpload /> on a real Web Forms page. v5.3 drop zones support recursive folder upload, the offline queue, and the cloud-source picker side-by-side with local drag-and-drop.

Drag and drop is already on

There is no property to switch on. DropZone defaults to true, so the markup below already accepts files dropped from Explorer or the Finder, and still works as a normal browse button:

<au:AjaxFileUpload ID="Uploader1" runat="server" AllowMultiple="true"
                   AutoPostBack="true" OnFileUploaded="Uploader1_FileUploaded" />

Set DropZone="false" if you want a browse-only control. EnableDropZone is a compatibility alias for the same property.

Four drop patterns, one property each

Each pattern is a single boolean on the control. Defaults are listed so you can see exactly what you get before changing anything.

PropertyDefaultWhat it does
DropZonetrueThe control itself accepts drops.
FullPageDropfalseThe whole window becomes the drop target - useful when the uploader sits below the fold.
FolderDropfalseDropping a folder walks it recursively instead of ignoring it.
DropOverlayfalseDims the page and shows DropOverlayText while a drag is in progress.

Dropping a folder keeps its structure

FolderDrop="true" handles dragged folders; WebkitDirectory="true" turns the browse button into a directory picker. Either way each file carries its relative path, which arrives on the event you already handle as e.RelativePath - traversal-sanitized, so it is safe to combine with your storage root:

protected void Uploader1_FileUploaded(object sender, FileUploadedEventArgs e)
{
    // e.RelativePath: "photos/2026/beach.jpg" for folder drops, null for plain files.
    var relative = e.RelativePath ?? Path.GetFileName(e.FileName ?? "file");
    var destination = Path.Combine(Server.MapPath("~/App_Data/uploads"),
                                   relative.Replace('/', '\'));
    Directory.CreateDirectory(Path.GetDirectoryName(destination));
    new UploadService().CopyFile(e.FileGuid, destination);
}

Folder support is covered in full on Folder uploads.

Pasting instead of dropping

Not every image starts life as a file on disk. A screenshot lives on the clipboard, and dragging it somewhere first is a detour. Clipboard paste is on by default too — see paste upload, which covers how pasted screenshots are named and how to widen the paste target to the whole page.

Dropping large files

Dropping a file does not change how it is transmitted, so the usual Web Forms ceiling still applies: a single POST is bounded by maxRequestLength and maxAllowedContentLength. Chunked upload sidesteps both by sending the file in pieces - see Uploading large files, or Troubleshooting if a drop is failing at a consistent size or time.

Working demos