form with enctype="multipart/form-data" hangs on some machines - image

I am having a form on which I upload pictures, thus it is set with the attribute enctype="multipart/form-data". The problem is on just a few machines and on any browser, after submitting the form, it keeps searching forever and finally get a 404 error.
As soon as I remove the "enctype="multipart/form-data" the form processes fine (except of course that pictures cannot be uploaded).
It works absolutely fine on my PC, anyone would have an idea what can cause this problem?
The full form tag is written this way:
<form method="post" id="add-property" action="<?=BASE_URL;?>admin/cms-add-property-action.php" enctype="multipart/form-data">
Thanks a lot.

Related

AntiSamy is not allowing me to input form fields

I have a RichTextArea from CKEditor. And I recently made some changes to sanitize HTML input.
Normal things go through fine but any form fields like checkboxes, textareas, radio buttons etc are stripped out.(I am using getValidSafeHTML to sanitize my HTML).
I have tried different policy files like this thing here which is supposed to allow everything
http://code.google.com/p/owaspantisamy/downloads/detail?name=antisamy-anythinggoes-1.4.4.xml
For example,
<form method="get" name="sampleform"><input name="radio" type="radio" /> </form>
becomes
<form method="get" name="sampleform"> </form>
Anybody have any idea why this is happening?
Thanks in advance
I just found the reason why this is happening... I was using the antisamy-1.3.jar. This looks like a bug in this version of antisamy. I needed to upgrade to antisamy-1.5.3.
So just check the versions of your antisamy jars. You might be facing the same issue

Magento - Checkout page not loading https URL for catalogsearch

I have just set up a Magento store and eveything is working fine, except for a problem in the catalog search URL.
When I go to the checkout page, everything is loaded in HTTPS, except for the catalog search URL, which makes chrome give a warning saying that there's mixed content in the page. When I check the source code, it says:
<form id="search_mini_form" action="http://XXXX/catalogsearch/result/" method="get">
But that only happens when the user is not logged in (or a first time customer). Once the user is logged in, the URL is loaded properly:
<form id="search_mini_form" action="https://XXXX/catalogsearch/result/" method="get">
Any idea on why this could be happening?
Thanks!
I know it's not the complete solution, and I have no idea why this is happening also on my store - but a temporary "patch" would be to open:
app/design/frontend/fogento/default/template/catalogsearch/form.mini.phtml
and manually modify the first line of the form element to use the secure url including https.
For example:
<form id="search_mini_form" action="https://www.yoursite.com/catalogsearch/result/" method="get">
This will give you the green address bar in chrome.

Posting to iframe works in Chrome but not IE or FF

I have a page with a container that gets different content from an ajax request. This content has a form that posts data (and a file) to an iframe that is also in this ajax content container. I can submit the form and it works perfectly in Chrome, but Firefox and IE just sit there like I never clicked the submit button. I have default security settings on each browser, and don't want to change them for this functionality. Can anyone see any bugs in my code or process that would cause this? thanks in advance!
form:
<form action='processUploadFrame.php' method='post' enctype='multipart/form-data' id='myForm' target='iframeUpload'>
<input type='submit' value='Upload' />
iframe:
<iframe name='iframeUpload' frameborder=1 width=750 height=150></iframe>
Solved. My HTML 101 has failed me. Having my submit button in a different table cell than the rest of the form doesn't work in IE and FF, but Chrome is okay with it. Strange. A simple javascript submit link did the trick:
<a href='javascript:document.getElementById(\"myForm\").submit();'>Submit</a>
Here's an article that reminded me about the rules of such: http://www.cs.tut.fi/~jkorpela/forms/tables.html

joomla backend nothing shown on any task

Can somebody give me a clue on what's happening here. It is strange that PHP gives me no error, nor warning, anything at all.. but it does not work..
here is my last set of changes https://bitbucket.org/brankito/making-chat-app-in-joomla/commits/71281244694631463b45853563ad1d2913ca74e4#Ladministrator/components/com_explore/views/activities/tmpl/default.phpT10
, when i load url which loads my list view in backend, [view=activities], it's all ok, i see my toolbar, and published [green checkmark] buttons, but when i click unpublish on any item, or select more of them and click unpublish in toolbar area, instead of doing that action and returning me back on same view, my browser shows url correctly but i get nothing in my view, no list, and no toolbar icons, no errors from php at all, so i dont have a clue where to begin.
Looks like you're loosing your view after submitting form, try to replace this:
<form action="<?php echo JRoute::_('index.php?option=com_explore'); ?>" method="post" name="adminForm" id="adminForm">
with:
<form action="index.php?option=com_explore&view=activities" method="post" name="adminForm" id="adminForm">

how to send file data using Dajaxice?

I am using ajax for my website. I have successfully used jQuery.ajax() to asynchronously upload file to server. I am using Dajax and Dajaxice therefore I plan to use these application for file upload as well. I tried this example. It is working fine. But if I add file field into my html form, it does not send file to server. My html form looks like
<form id="myform" action="/file/" method="post" enctype="multipart/form-data">
<div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='AaSmyBEwQLSD3YghRAD9Cf2uxEjzESUe' /></div>
<p><label for="id_docfile">Select a file</label> max. 42 megabytes</p>
<p><input type="file" name="docfile" id="id_docfile" /></p>
<p><input type="submit" value="Upload" /></p>
</form>
This question has been asked at many place but never answered.
Afaik there is currently no provision within dajax / dajaxice to upload files.
I have used dajax in a few projects and have got round this by using blueimp/jquery-file-upload and a django view that accepts a POST of the upload file and return a JSON string to the client.
This is a less than perfect solution not least because the jquery-file-upload button is styled differently from normal html form elements, it is possible to style the whole form using jQuery-ui, although this is a lot of additional work.
Both, dwr which is pretty much dajax for Java, and tasty pie for django do offer file uploading, so in theory it should be possible to implement it.
I'm happy to post a sample of my ajax solution if anyone would find them useful.
I've also faced this problem recently. So, I've digged a little and discovered some answers.
It is working fine. But if I add file field into my html form, it does not send file to server.
There's serialize() method used in the doc example. But according to the jQuery doc:
Data from file select elements is not serialized.
Also, there's no clear way to get ajax file upload, because JS doesn't have access to the outside of the client browser. So, I don't think it's possible to make using dajaxice.
The easiest hack, I've found is to post form to the invisible iframe using target option:
<form method='POST' action='/upload' enctype='multipart/form-data' target='submit-iframe'>
so, only the iframe will be refreshed. Using js you than can get data from it catching the load() event.
More detailed process described here

Resources