jquery - how to copy the source src to folder using ajax -
my html file
<input type="submit" value="submit" name="submit" id="btsubmit" onclick="getsrc()">
my script
i took source path
<form id="f1" name="form1" method="post"> var imagesrc = document.getelementbyid("clonedelementx").src; </form>
my ajax code
need copy source path targeted path using ajax $('#btsubmit').change(function() { $(imagesrc).ajaxform({ target: "c:\users\bhargavi\workspace\html\storedimage" }).submit(); return false; });
i new ajax please me did wrong in
i have'nt checked this.but might you... :)
html
<div id='preview'></div> <form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'> <input type="file" name="photoimg" id="photoimg" /> </form>
script file
$('#photoimg').live('change', function() { $("#imageform").ajaxform({target: '#preview', //shows response image in div named preview success:function(){ }, error:function(){ } }).submit(); });
ajaximage.php
if(isset($_post) , $_server['request_method'] == "post") { $name = $_files['photoimg']['name']; $size = $_files['photoimg']['size']; $tmp = $_files['photoimg']['tmp_name']; $path = "uploads/"; move_uploaded_file($tmp, $path.$name) //stores image in uploads folder }
Comments
Post a Comment