Is it possible to POST some XML data i have as string as file input type from a html form.
The case is i have a form like
form action="target.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
I have some xml data as string in my javascript code and i want to sent that string from the form as if it was uploading as a file with the file input tag
Thanks
If your browsers supports XMLHttpRequest level 2 and the html5 FileApi you can do the following
If your browser doesn't support these apis then you'll have to build your post body manually