This is the jquery that i'm using.
I need to use the returned data and store it in a db usin php.
'onComplete' : function(event, ID, fileObj, response, data) {
alert('Your video has been uploaded. Thanks.');
Now inside this, i want to use the retuned fileOBJ and store it. How do i do that?
-
2Please provide more context. Where is this callback being called from and after what kind of action?Pekka– Pekka2011年02月18日 20:13:12 +00:00Commented Feb 18, 2011 at 20:13
-
3You need to send the data via AJAX to a PHP script.gen_Eric– gen_Eric2011年02月18日 20:14:43 +00:00Commented Feb 18, 2011 at 20:14
2 Answers 2
You could place an AJAX call inside of the function that submits the data to the php page.
'onComplete' : function(event, ID, fileObj, response, data) {
alert('Your video has been uploaded. Thanks.');
$.ajax({
type: 'POST',
url: 'your_php_page.php',
data: fileOBJ,
success: function(msg) {
//do something
},
error: function(msg) {
//handle error
}
});
}
Then you'd simply create a php page that would submit the posted data to your database.
Read more about the $.ajax() call here.
answered Feb 18, 2011 at 20:18
jon3laze
3,2066 gold badges42 silver badges69 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
This technique is usually referred to as "Ajax" these days. The scope of your question is too broad to answer here, I recommend you do some reading on it.
answered Feb 18, 2011 at 20:14
Jim
74.1k15 gold badges105 silver badges114 bronze badges
Comments
default