Domanda

We have some really old code from which one part like 15k lines of code make a really old fashioned procedural form content menagment system.

Now here comes the stupid part. Whole code is based so it nests form elements. Wich is by definion wrong. we have code like

<form action="demo_post_enctype.asp" method="post" enctype="multipart/form-data">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
  .
  .
  .
  .
  <form enctype="multipart/form-data">
     <input type='File'>
  </form>

</form>

Now this is only the teoretical layout. the whole thing is so complex and "uniquely" unprofesionally made that my head hurts.

The strange thing is it works, kinda, no idea how. And now we have a problem to upload files bigger then around 28mb. I checked the server settings it is set to 1gb upload size and it works without problems in the new refactored parts it works.

Question:

What is the effective upload size of such buggy code?

We need to give curent users the feedback while the old code gets refactored.

È stato utile?

Soluzione

Although the code doesn't work as intended, it can still work in a sense. As nested forms are invalid, as far as I know all browsers will handle the problem by ignoring the starting tag for the inner form, and end the form at the ending tag of the inner form.

So, as long as the inner form is at the end of the outer form, it will be a single form containing all the fields, and will be posted to the action of the outer form.

While there will be some extra fields included when you upload a file, that would hardly account for so much data that the upload size would be noticably reduced. Perhaps it's the fact that the data is posted to a different page than intended that causes the problem.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top