Reputation: 3308
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
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
Reputation: 8287
Dojo's xhr methods don't support binary data. You might want to use dojox.form.Uploader
Upvotes: 2