# How to add progress bar when click upload button?

**URL:** <https://forum.freecodecamp.org/t/how-to-add-progress-bar-when-click-upload-button/473740>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [August 13, 2021, 6:37pm UTC](https://forum.freecodecamp.org/t/how-to-add-progress-bar-when-click-upload-button/473740 "2021-08-13T18:37:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmedsa.aziz.ba](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ahmedsa.aziz.ba/32/186098_2.png) [@ahmedsa.aziz.ba](https://forum.freecodecamp.org/u/ahmedsa.aziz.ba)\
**Post date:** [August 13, 2021, 6:37pm UTC](https://forum.freecodecamp.org/t/how-to-add-progress-bar-when-click-upload-button/473740/1 "2021-08-13T18:37:45Z")

</div>

I work on angular 8 application I need to add progress bar

when click upload button so progress bar will work when click

button upload until finish upload

upload service

```javascript
PostUpload(file)
{
  const formData: FormData = new FormData();
  formData.append('file', file,file.name);
 return this.http.post('http://localhost:61265/api/DeliverySys/', formData,{responseType: 'blob'});
}
component upload.ts

public uploadFile = () => {
this._dataService.PostUpload(this.selectedoptions.toString(),this.fileToUpload)

 .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name + '.xlsx'));
}
component upload.html

<button (click)="uploadFile()"></button>

```

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [August 16, 2021, 3:54pm UTC](https://forum.freecodecamp.org/t/how-to-add-progress-bar-when-click-upload-button/473740/2 "2021-08-16T15:54:53Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [February 15, 2022, 3:55am UTC](https://forum.freecodecamp.org/t/how-to-add-progress-bar-when-click-upload-button/473740/3 "2022-02-15T03:55:06Z")

</div>

Closed on February 15, 2022, 3:55am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
