1e41f4b71Sopenharmony_ci# Upload and Download Subsystem Changelog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## cl.request.2 Upload and Download API Change
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci- Deleted the beta APIs in API version 9:
7e41f4b71Sopenharmony_ci1. function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;
8e41f4b71Sopenharmony_ci2. function download(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>;
9e41f4b71Sopenharmony_ci3. function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void;
10e41f4b71Sopenharmony_ci4. function upload(context: BaseContext, config: UploadConfig): Promise<UploadTask>;
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci**Change Impact**
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ciThe application developed based on the Stage mode of earlier versions needs to be adapted. Otherwise, the service logic will be affected.
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci**Key API/Component Changes**
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci| Module         | Class          | Method/Attribute/Enumeration/Constant                                                                                                      | Change Type|
19e41f4b71Sopenharmony_ci|--------------|--------------|-------------------------------------------------------------------------------------------------------------------|------|
20e41f4b71Sopenharmony_ci| ohos.request | request      | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;     | Deleted.  |
21e41f4b71Sopenharmony_ci| ohos.request | request      | function download(context: BaseContext, config: DownloadConfig): Promise<DownloadTask>;                           | Deleted.  |
22e41f4b71Sopenharmony_ci| ohos.request | request      | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback<UploadTask>): void;           | Deleted.  |
23e41f4b71Sopenharmony_ci| ohos.request | request      | function upload(context: BaseContext, config: UploadConfig): Promise<UploadTask>;                                 | Deleted.  |
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci**Adaptation Guide**
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ciThe following sample code shows how to call **downloadFile** in the new version:
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci```ts
31e41f4b71Sopenharmony_citry {
32e41f4b71Sopenharmony_ci    request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap',
33e41f4b71Sopenharmony_ci        filePath: 'xxx/xxxxx.hap'}, (err, data) => {
34e41f4b71Sopenharmony_ci        if (err) {
35e41f4b71Sopenharmony_ci            console.error('Failed to request the download. Cause: ' + JSON.stringify(err));
36e41f4b71Sopenharmony_ci            return;
37e41f4b71Sopenharmony_ci        }
38e41f4b71Sopenharmony_ci    });
39e41f4b71Sopenharmony_ci} catch (err) {
40e41f4b71Sopenharmony_ci    console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message);
41e41f4b71Sopenharmony_ci}
42e41f4b71Sopenharmony_ci```
43