Primeng: Can't upload file using PUT request

Created on 17 May 2017  路  6Comments  路  Source: primefaces/primeng

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior

fileUpload component always sends POST request to server.

Expected behavior

Add method attribute to let user uses POST or PUT

new feature

All 6 comments

Although I'm setting method to be put
<p-fileUpload ... [method]="'PUT'"> </p-fileUpload>
it is still trying to send a POST request :\

Same is still happening to me. I checked the source code and figured out that calling POST method is hard coded and it doesn't use method

Same is still happening to me. I checked the source code and figured out that calling POST method is hard coded and it doesn't use method

how did you solve it?

Same is still happening to me. I checked the source code and figured out that calling POST method is hard coded and it doesn't use method

how did you solve it?

I set the params like below
customUpload="true" and (uploadHandler)="myUploader($event)"

Then in myUploader method I called the put method in API request and it worked.

Same is still happening to me. I checked the source code and figured out that calling POST method is hard coded and it doesn't use method

how did you solve it?

I set the params like below
customUpload="true" and (uploadHandler)="myUploader($event)"

Then in myUploader method I called the put method in API request and it worked.

please, could you send me the code for the "myUploader" method, [email protected]

Same is still happening to me. I checked the source code and figured out that calling POST method is hard coded and it doesn't use method

how did you solve it?

I set the params like below
customUpload="true" and (uploadHandler)="myUploader($event)"
Then in myUploader method I called the put method in API request and it worked.

please, could you send me the code for the "myUploader" method, [email protected]

myUploader(event) {
event.files.map((_file) => {
this.httpClient.put(response.url, _file);
});
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

just-paja picture just-paja  路  3Comments

papiroca-tm picture papiroca-tm  路  3Comments

markgoho picture markgoho  路  3Comments

Faigjaz picture Faigjaz  路  3Comments

jisqaqov picture jisqaqov  路  3Comments