Перейти к содержимому


Фотография
- - - - -

Multipart vs URLEncoded form Posting for Front End Submission Forms


  • Закрытая тема Тема закрыта
В теме одно сообщение

#1 renee

renee

Отправлено 20 December 2013 - 18:49

I've been working on integrating two websites using an automated form posting method. The form is a front end submission form for a JBZoo App.

 

The third party that will post data told me they could use a form post method. I sent them a url for the front-end submission form I created to confirm it is OK and they got back to me saying they can work with it but that they usually work with application/x-www-urlencoded posting rather than the multipart/form data type form created for the JBZoo app submission.

 

It seems the difference is that using a urlencoded posting method the data can be sent as one chunk with fields separatd by & and special characters denoted with %HH codes.

 

I know that some form components, RSFormPro for example, allow the post method to be changed to urlencoded. But I don't know enough about the differences in methods to know what the implications of using one method versus another are.

 

So, the question, from the JBZoo App front-end submission point of view:

 

  • is there a specific reason why the multipart method is used (I'm guessing this is just typical for forms usually created for manual processing)
  • is it possible to change the post method to urlencoded if necessary (the form will not be filled manually ever)
  • are there any foreseeable problems using one method over another?

If not it seems as though the multipart method is acceptable - I'm just pre-empting problems as there is a deadline on the project.

 

Thanks.


  • 0

#2 Kess

Kess

Отправлено 21 December 2013 - 14:05

This is how ZOO submission works by default.

 

You can change this in this file: components/com_zoo/partials/_submission.php

 

There is this code in there:

<form id="item-submission" action="<?php echo JRoute::_($this->app->route->submission($this->submission, $this->type->id, null, $this->item->id, $this->redirectTo)); ?>" method="post" name="submissionForm" accept-charset="utf-8" enctype="multipart/form-data">

You can change enctype to "application/x-www-form-urlencoded" and it should work fine. There shouldn't be any problems if you only submit simple forms and don't attach files.


  • 0




Click to return to top of page in style!