2

I'm using umbraco with extensionless urls. I've inserted a simple piece of HTML in one of my masterpages (en/test) :

<form method="post" enctype="multipart/form-data">
  <input type="submit" />
</form>

When I press the submit button, I get a 404. The path is exactly the same and should exist. When I remove the enctype part, the submit occurs fine.

I can't figure out how to fix this, but I bet it has something to do with the rewriting.

I also tried the following without success:

<form method="post" enctype="multipart/form-data" action="/en/test">
  <input type="submit" />
</form>

<form method="post" enctype="multipart/form-data" action="/en/test.aspx">
  <input type="submit" />
</form>

The only page where I CAN use the enctype attribute, is on the actual homepage. I guess this has to do with the fact that the physic default.aspx exists.

=============== UPDATE =================

There is only one form element in the page, the one that I've inserted. So a "whole page" form element is certainly not the case. Secondly, yes the form is in theory posting back to itself. I also tried an empty action tag, plus an action tag with the full url as suggested, with the same results.

When I either use the following scenario's:

  • No action attribute
  • action=""
  • action="{relative path}"
  • action="{absolute path}"

I end up on exact same URL as where I fired the submit from. But it's a 404. When I press the enter key in my address bar, no 404, I'm back at my original page with the same URL.

Gerhard Schreurs
  • 663
  • 1
  • 8
  • 19

1 Answers1

0

First question I should ask is do you get a 404 when you browse to "/en/test" or "/en/test.aspx". For the form to post back to itself try an empty action e.g. action="" or writing the current url into the action attribute. And one further question, do you have another form wrapped around your page with the runat="server" attribute because if you have you will end up with nested forms which will also cause you issues.

On a side node I would strongly suggest upgrading your installation to at least v4.11.4 due to a bug that was introduced in 4.10. Please see the following for details...

Trying to publish a root node (parent) after unpublishing a child result in a YSOD: http://issues.umbraco.org/issue/U4-1491

Path Fixup http://our.umbraco.org/projects/developer-tools/path-fixup

ProNotion
  • 3,662
  • 3
  • 21
  • 30
  • Thank you kindly for your reply. There is only one form element in the page, the one that I've inserted. So a "whole page" form element is certainly not the case. Secondly, yes the form is in theory posting back to itself. I also tried an empty action tag, plus an action tag with the full url as you suggested, with the same results. When I either use the following scenario's: No action attribute, action="", action="{relative path}", action="{absolute path}": I end up on exact same URL as where I fired the submit from. But it's a 404. When I press the enter key in my address bar, no 404. – Gerhard Schreurs Mar 01 '13 at 13:26
  • I also updated my main question with your response to further clarify. Thank you for mentioning the umbraco update, but this *should* have nothing to do with my upload problem, however. – Gerhard Schreurs Mar 01 '13 at 13:32