Pravitha V
Pravitha V

Reputation: 3308

Uploading an image in dojo

How to upload an image in Dojo with its ajax call? The url of the image must get stored to the database.Is there anyway to do it?

Upvotes: 0

Views: 1017

Answers (2)

Ricardo Garza V.
Ricardo Garza V.

Reputation: 909

you could try an aproach using a hidden iframe

<form enctype="multipart/form-data" target="magicFrame" action="uploader.php">
    <input type="file" name="image" />
    <input type="submit" />
</form>
<iframe name="magicFrame" id="magicFrame" style="display: none" ></iframe>

this will achieve the same result as uploading the image by AJAX (is not currently posible)

Upvotes: 1

0xc0de
0xc0de

Reputation: 8287

Dojo's xhr methods don't support binary data. You might want to use dojox.form.Uploader

Upvotes: 2

Related Questions