EXIF Orientation

Demo uploads land in a temporary store and are swept after 60 minutes. To keep files, handle FileUploaded — see Single File for the complete save pattern.
EXIF Auto-Rotation Awareness

Photos from cameras and phones often contain EXIF orientation metadata. This demo detects the EXIF orientation tag and displays both the raw image and the correctly oriented version using canvas transforms.

What you should see: sideways phone photos (JPEG) are straightened automatically from their EXIF orientation before upload. Auto-upload is off so you can compare before sending.
Drag & drop files here, or paste from clipboard
<au:AjaxFileUpload ID="Uploader1" runat="server"
 EnableExifOrient="true"
 AllowedExtensions=".jpg,.jpeg"
 AutoUpload="false" />

// JavaScript: Read EXIF orientation from binary data
function getExifOrientation(file, callback) {
 var reader = new FileReader();
 reader.onload = function(e) {
 var view = new DataView(e.target.result);
 // Parse JPEG markers to find EXIF orientation tag (0x0112)
 // Returns orientation value 1-8
 };
 reader.readAsArrayBuffer(file.slice(0, 65536));
}

// Apply orientation transform to canvas context
function applyOrientation(ctx, orientation, w, h) {
 switch (orientation) {
 case 3: ctx.rotate(Math.PI); ctx.translate(-w, -h); break;
 case 6: ctx.rotate(Math.PI / 2); ctx.translate(0, -h); break;
 case 8: ctx.rotate(-Math.PI / 2); ctx.translate(-w, 0); break;
 }
}