-
Notifications
You must be signed in to change notification settings - Fork 32
File uploading with PUT method with Method Override #89
Comments
@Channad I think the issue comes because the |
@Channad Also... The Angular 4 HttpClient (https://angular.io/api/common/http/HttpClient) provides methods for HTTP methods other than GET and POST - it also supports HEAD, PATCH, PUT, and DELETE. As such, you may not even need to use the |
Mathewe As I mentioned the need for the Method Override is due to the restrictions on the SSL based commercial server which does not allow PUT and DELETE and even OPTION is not allowed. |
@ezimuel , Thanks Enrico the -1000 did the trick, it resolved the problem. Also in my issue I also mentioned that the |
Sorry I accidentally closed the issue. Well the priority setting fixed the PUT issues on file upload but it breaks every thing else. All other methods fail such as they work ok with a priority setting of -100, but then the What am I to do to fix this??? Can I override the HttpMethodOverrideListner class and set the priority for those tables which needs |
@Channad ok, I need to test it properly. It will require some times since I need to provide a full unit test to debug it. I'll let you know asap. |
Hi Enrico, Few more updates from my side I think may help you to help all of us. At priority level –1000 the system works without a problem if I have the At present I have not enabled All tables with The Issue is with those tables which has So the issue seems to be that Overriding Listener is intercepting the "Allowed Methods" validation listener at priority level -1000. Hope this will help your debugging process! Best regards |
@ezimuel RE If I need to allow empty on the file upload, I should remove the Best regards |
This repository has been closed and moved to laminas-api-tools/api-tools-content-negotiation; a new issue has been opened at laminas-api-tools/api-tools-content-negotiation#4. |
I am trying to upload a file in a form with other data fields provided via Angular 4. With lot of difficulty I managed to get it posting properly. It requires that I remove the
Content-Type
header from the ajax posting.So now both POST and PUT works as normally. However I have encountered a problem with apigility behavior when it comes to
X-HTTP-Method-Override
header. The POST method still works fine but PUT fails on input validation. Apigility reports all my required fields as empty when actually they are not.As I said this happens only when I use POST with Method Overriding to PUT.
Also noticed that
allow_empty
andcontinue_if_empty
does not work.My production server does not support PUT & DELETE methods. So I need to get this working.
My
module.config.php
has the following for the specific file upload field:My Template has the following among others:
My data service has the following:
The Response I get is:
My Browser says this
The text was updated successfully, but these errors were encountered: