I’m developing a Blackberry OS 5 + application and I need to send some data with an image.
To develop this application I’m using HTML5, jQuery and Webworks SDK.
With a form like this:
<form method="post" action="htt://doamin.com/fool/problem" >
<input type="text" name="post[tipo]" value="7" />
<input type="text" name="post[lat]" value='4312.143234388223E7' />
<input type="text" name="post[lon]" value='2112337733237.0' />
<input type="text" name="post[desc]" value='axxxx.' />
<input type="text" name="post[riesgo]" value='1' />
<input type="text" name="post[direccion]" value='Cxxx' />
<input type="text" name="post[municipio]" value='zzz' />
<input type="text" name="post[pais]" value='ES' />
<input type="text" name="post[idCobranded]" value='1' />
<input type="text" name="post[esRegistro]" value='1' />
<input type="text" name="post[origen]" value='2' />
<input type="text" name="post[version]" value='1.1.0' />
<input type="text" name="post[email]" value='email@email.com' />
<input type="text" name="post[password]" value='ba65b0d6c8c76cabb343fccfdeba053a' />
<input type="text" name="post[nombre]" value='asdsad' />
<input type="text" name="post[codigoPostal]" value='213218222' />
<input type="text" name="post[idioma]" value='1' />
<input type="submit" class="submit" value="Send"/>
</form>
It is the first time that I do it and I don’t know how to do it.
How can I send that form with an image as a multipart-form using jQuery?
By the way, I’ve found $_FILE, What is it?
$_FILE is a php array that store all your uploaded data information. Since, you you’re not using PHP, you wouldn’t have to worry about it. However, if you are interest, you can find more information about it here
http://www.php.net/manual/en/reserved.variables.files.php
Did you look into jquery $.ajax function to send your form information to your webservice? You can also use $.post. Also, for each of the input field in your form I would suggest you to add an ID field since you will be dealing with javascript 🙂