文件最后提交记录最后更新时间
!974 更新网络相关权限信息,删除未使用变量,代码规范整改3 年前
!960 README整改3 年前
!929 翻译已完成#I5CXTV及I5DVFX3 年前
!966 README整改3 年前
!881 【OpenHarmony】新增UploadDownload3 年前
!881 【OpenHarmony】新增UploadDownload3 年前
!881 【OpenHarmony】新增UploadDownload3 年前
README.md

Upload/Download

Introduction

This sample demonstrates how to use the upload and download interfaces to upload and download files.

Concepts

Upload and download

Transfer files from a mobile phone to a remote server and vice versa.

Required Permissions

The following permission must be declared in the config.json file:

"reqPermissions": [{"name": "ohos.permission.INTERNET"}]

Usage Guidelines

  1. Start the application and request for access to the remote server. A list of files on the remote server will be displayed. Select the file to download and click download. The file on the remote server is downloaded to the mobile phone, and the download progress is displayed.

  2. Tap next to go to the upload page, and tap upload. The local file is uploaded to the remote server, and the upload progress is displayed.

Constraints

  1. This sample can only be run on standard-system devices.

  2. DevEco Studio 3.0 Beta3 (Build Version: 3.0.0.901, built on May 30, 2022) must be used.

  3. HTTPS is supported by default. To support HTTP, you need to add the network field to the config.json file, and set the cleartextTraffic attribute to true, that is: "deviceConfig": { "default": { "network": { "cleartextTraffic": true } } }