Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upload file using PUT request #2808

Closed
jiarongxu opened this issue May 17, 2017 · 6 comments
Closed

Can't upload file using PUT request #2808

jiarongxu opened this issue May 17, 2017 · 6 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@jiarongxu
Copy link

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

@cagataycivici cagataycivici self-assigned this May 26, 2017
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label May 26, 2017
@cagataycivici cagataycivici added this to the 4.0.2 milestone May 26, 2017
@igor-pavlichenko
Copy link

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

@AminTizdastAzar
Copy link

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

@olavoalvesneto
Copy link

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?

@AminTizdastAzar
Copy link

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.

@olavoalvesneto
Copy link

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, olavoalvesneto@hotmail.com

@AminTizdastAzar
Copy link

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, olavoalvesneto@hotmail.com

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

5 participants