Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
597 views
in Q2A Core by
Hi,

 

I wanted to change the ajax file to accept a image file when I give the answer, but the code makes the image a $_POST var instead of a $_FILE after going to the AJAX script. Can someone help me?

The code I have added to the answer form :

'tags' => 'method="post" enctype="multipart/form-data" action="'.qa_self_html().'" name="a_form" ',

...

'foto' => array(
                        'label'=> 'Imagem',
                        'type' => 'custom',
                        'html' => '<input type="hidden" name="MAX_FILE_SIZE" value="10000000" /><input name="imgAns" type="file" id="imgAns"/>'
                
                        ),
Q2A version: 1.6.3

1 Answer

0 votes
by

Can someone please help me with this? I have tried to change the ajax and the jquery, but I'm not able to get the image to upload because it becames a $_POST after the jquery process q2a makes. sad

 

I consider this one of the most important things in my q2a site.

Thanks

...