Overview
TheOnlyOfficeHandler.ashx is an ASP.NET HTTP handler that processes document-related requests for the OnlyOffice Control library. It implements the IHttpHandler interface and provides three main actions for document management.
Handler Endpoint
Available Actions
The handler supports three primary actions, specified via theaction query parameter:
download
Downloads a document file from the server storage.callback
Receives document status updates from OnlyOffice Document Server when users edit or save documents.proxy
Proxies external document requests to handle CORS restrictions and security validation.Error Handling
If an invalid or missing action is provided, the handler returns:HTTP status code indicating bad request
Error message in plain text format
Example Error Response
File Storage
All document files are stored in the~/App_Data/uploads directory. The handler automatically creates this directory if it doesn’t exist.
File Naming Convention
Files are stored with the pattern:{fileId}.{extension}
For example:
doc123.docxsheet456.xlsxpresentation789.pptx
Implementation Details
Namespace
Class
Handler Registration
Ensure the handler is registered in yourweb.config:
Security Considerations
TLS Configuration
The handler enforces secure connections for external requests:Next Steps
Download Action
Learn how to download documents from storage
Callback Action
Handle document save callbacks from OnlyOffice
Proxy Action
Proxy external document requests