Here after uploading an image if anyone want to remove the uploded image that part is not working.can anybody help me how to remove image after uploading with ajax
Post Date: Jul 06, 2009 12:37:45
Asif D. Khalyani says:
Comment:
Hi, chaitali debnath
You can remove function image path to call ajax function delete those image, very easy.
Post Date: Aug 26, 2009 10:39:58
virk6 says:
Comment:
Hello, Please, can you give us the source code of the ajax function to delete an image and also a function to refresh the frame after the delete completes ..
Thanks you very very much ..
Post Date: Oct 12, 2009 12:21:25
Asif D. Khalyani says:
Comment:
On Oclick you can call delete function call & remove that image easily
Post Date: Oct 18, 2009 09:41:53
virk6 says:
Comment:
Mr Asif D. Khalyani, have you tried this delete function to remove image easily ?? It is not working at all and you get this error message : x Y: usrname.. If you have the code source that works well please let me know.
Thanks.
Post Date: Oct 23, 2009 04:58:06
pusp says:
Comment:
please append delete only in client side after the remove btn thanks
Post Date: Oct 30, 2009 10:55:26
virk6 says:
Comment:
Please, what do you mean by "append delete only in client side after the remove btn" ? which the source code you call client side after the remove btn ?
To resolve this problem can you give me the piece of the code source ?
Thanks you very much..
Post Date: Jan 01, 2010 05:41:19
Bengt says:
Comment:
Hi Asif D. Khalyani says
I don´t now where or what to change in upload script to get the remove function to work.
Could you please help me with the problem.
I´m not so good in programming.
Regards
Bengt
Post Date: Jan 16, 2010 02:04:28
ilker says:
Comment:
remove function won't work....
Post Date: Jan 16, 2010 06:28:56
pioter says:
Comment:
can you help with delete function?
Post Date: Jan 28, 2010 12:14:01
Asif D. Khalyani says:
Comment:
//Upload.php page line No:33
This Code Here --------------------------------------------------------------- var myLink1 = par.createElement('a'); myLink1.href = "#"; myLink1.className = "blacklink"; ============================================== /*myLink1.onclick=function(e){alert('x'+' Y: '+'usrname');} */
//We Can Call Here Delete Function Above Line Delete or Comment like this //I am writing for delete function call here
myLink1.onclick=function(e){delete_image('id');} // I am calling function with image id passed
/**** DELETE Image Function delete_image.js this one add in your main index page***/ function delete_image(image_id) { var data; data="image_id="+image_id; var url = '../script/delete.php'; // Call Delete Page & In this page delete those image & db entry var myAjax = new Ajax.Request(url,{method:'post', parameters: data, onComplete: delete_image_Changed} ); return false; }
function delete_image_Changed(originalRequest) { if (originalRequest.readyState==4) { //alert(originalRequest.responseText); if(originalRequest.status==200) { response = originalRequest.responseXML.documentElement;
var str; var divid; var d_id; var result_flag; try { result_flag = response.getElementsByTagName('result_flag')[0].getElementsByTagName('result')[0].firstChild.nodeValue; if(result_flag == "true") { alert('Image Not Delete'); } else { alert('Image Deleted'); }
}catch (e) {
} } else { alert("There was a problem retrieving the XML data:\n" + req.statusText); } } }
hello Asif thanks for your tips but must be there something more easy (and without a DB connection), like:
myLink1.onclick= function() {delete(this.name)};
and a short function to remove the nodes:
function delete(obj) { de = document.getElementById('iframe'); de.removeChild(document.getElementById(obj)); }
I hate to work with nodes and don't found yet the way to make it work hehe..
Post Date: Apr 24, 2010 10:32:32
asdasdasd says:
Comment:
hello! nice script! Just a question: I'm trying to don't store the original jpg, but a resized one (i mean, I could need to have by default all images smaller than 300X300 pixels).
So.. resize.php will create the preview thumbnail. Where I should add a resizing script BEFORE the storing of the original jpg?
thanks a lot.
Post Date: Apr 24, 2010 06:56:40
asdasdasd says:
Comment:
hmmm maybe I got it :D
I've changed "if" part in resize.php: =================================================== if($_GET['pic']){ $img = new img('upload/'.$_GET['pic']); $width = $_GET["width"]; $height = $_GET["height"]; $img->resize(300,300,true); $img->store('upload/'.$_GET['pic']); $img->resize(100,100,true); $img->show(); } // and the funct. resize parameters: function resize($width, $height, $aspectradio){
So, with the first resize I got a medium-sized image, then I store it. After that, I resize again to get the thumbnail.
I've also changed the first part of upload.php. ================================================= <?php /*timestamp to get unique names*/ $timestampfile = time();
if i click submit button email validation fired. that time image preview not show.
plz see here http://www.buysomebody.com/buy.php
Post Date: Apr 26, 2011 08:14:55
SAN says:
Comment:
Same issue Please help
"How to show a new image on the place of old image?
(And not next to the old image)"
Thank you
Post Date: Jul 06, 2011 06:54:15
samerhdid says:
Comment:
I Love This Script .
Post Date: Aug 04, 2011 09:12:15
jstudds says:
Comment:
doesn't work for me, upload in the directory works fine but image will not display despite changing <?=(int)$_POST['imgnum']?> <?=$oname?> as suggested no good
Post Date: Nov 04, 2011 08:28:44
bhaskar says:
Comment:
i need delete image class but not in xml can anyone help me to give function ............pls
Post Date: Feb 22, 2012 04:34:21
sneha says:
Comment:
I am Getting error undefined index image in upload.php please any one can solve this error...
Post Date: Aug 23, 2012 03:05:40
hentaix2 says:
Comment:
Thanks you
Post Date: Oct 11, 2012 01:24:52
kamal says:
Comment:
Removal of image is not working... how to resolve it?
Here after uploading an image if anyone want to remove the uploded image that part is not working.can anybody help me how to remove image after uploading with ajax