Internet Engineering Task Force C. Reddy, Ed. Internet-Draft Independent Intended status: Informational 22 September 2024 Expires: 26 March 2025 Title File Size Download Prompt (FSDP) draft-reddy-pfsd-00 Abstract In the context of limited mobile data plans, it is crucial to manage data usage efficiently. This document proposes a method using the HTTP `OPTIONS` header to retrieve the size of a file before downloading. By checking the `Content-Length` header, users can be informed of the file size and prompted to confirm the download. This approach helps users avoid unexpected data consumption and ensures better control over their mobile data usage. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on 26 March 2025. Copyright Notice Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. Reddy Expires 26 March 2025 [Page 1] Internet-Draft Abbreviated Title September 2024 This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Key Goals . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. HTTP Options Request and Response . . . . . . . . . . . . . . 4 4. File Download Request from UI . . . . . . . . . . . . . . . . 4 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 6. Security Considerations . . . . . . . . . . . . . . . . . . . 4 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 7.1. Normative References . . . . . . . . . . . . . . . . . . 4 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction Using the HTTP OPTIONS method to check the Content-Length header before downloading a file can indeed help manage mobile data more efficiently. Here’s a brief overview of how this can be implemented: Reddy Expires 26 March 2025 [Page 2] Internet-Draft Abbreviated Title September 2024 +-----------------------------+ | Mobile/Browser Device | +-----------------------------+ | | HTTP OPTIONS Request v +---------------------+ | Web Server | +---------------------+ | | HTTP OPTIONS Response | (with Content-Length) v +-----------------------------+ | Mobile/Browser Device | +-----------------------------+ | | Check Content-Length v +---------------------+ | Decide to Download | | or Not | +---------------------+ | | If Download v +---------------------+ | Download File | +---------------------+ Figure 1: FSDP Workflow 2. Key Goals 1. All Browsers/Mobile Apps send an HTTP OPTIONS Request: Before downloading a file, send an OPTIONS request to the server hosting the file. 2. Retrieve the Content-Length Header: The server should respond with headers, including Content-Length, which indicates the size of the file. 3. Prompt the User: Based on the file size, prompt the user to confirm whether they want to proceed with the download. 4. Toggle Button: Every browser/mobile app has the option to turn on/off the feature to prompt. Reddy Expires 26 March 2025 [Page 3] Internet-Draft Abbreviated Title September 2024 3. HTTP Options Request and Response HTTP Request: OPTIONS /path/to/file HTTP/1.1 Host: example.com HTTP Response: HTTP/1.1 200 OK Allow: OPTIONS, GET, HEAD, POST Content-Length: 12345 Content-Type: text/html; charset=UTF-8 4. File Download Request from UI 1. Pre Flight-Response The browser sends a HTTP OPTIONS request to the server. The server responds back with the metadata of the file including the size of the file in Megabytes. The Browser/ Mobile Device shows a download confirmation prompt to the user. 2. Post Pre-Flight User Interaction Based on the size of the file, the user decides whether to download the file or not. If the user decides to download the file, it is saved to the downloads folder. 5. IANA Considerations This memo includes no request to IANA. [CHECK] 6. Security Considerations While it does not impact the Internet Security, the file downloads must only proceed if the user manually approves the download or enables the toggle button to allow all downloads regardless of file size.All browsers and mobile applications must adhere to FSDP regulations. 7. References 7.1. Normative References Reddy Expires 26 March 2025 [Page 4] Internet-Draft Abbreviated Title September 2024 [RFC7480] Newton, A., Ellacott, B., and N. Kong, "HTTP Usage in the Registration Data Access Protocol (RDAP)", STD 95, RFC 7480, DOI 10.17487/RFC7480, March 2015, . Acknowledgements This document was prepared using https://github.com/ietf-tools/ rfcxml-templates-and-schemas/blob/main/draft-rfcxml-general-template- annotated-00.xml Author's Address Clifton Savio Sanjay Reddy (editor) Independent 946 Francesca Ct League City, 77573 United States of America Email: cliftonreddy@gmail.com Reddy Expires 26 March 2025 [Page 5]