How to write the value of URL (in ajax script) if the files are not in the same folder? For example, if the jscript is in a different folder but is included in the index.php and the upload.php is also in a different folder, how to write the url value in the javascript/ajax code?
Append the other values in FormData object like this - var name = "Yogesh"; var city = "Bhopal"; fd.append('file',files[0]); // File fd.append('name',name); // Name fd.append('city',city); // City In the PHP file read name and city using POST. $name = $_POST['name']; $city = $_POST['city'];
@@makitweb Thanks, u are my hero now, you have not idea how many days try to resolve this, i have only one more question, i try to send this radio buttom in the var var_name = $('input[name=radio_name]=checked', '#form_id').val() fd.append('var_name', var_name); , but whitout results, i try like other var but nothing. again THNKS
Hi Arslan, No data is not send to database. You can view this tutorial -th-cam.com/video/4dU1yS6iwGI/w-d-xo.html to know how to save image to database.
Hi Carlos, You need to append data to FormData object for sending value to AJAX file. Example - fd.append(name,'Yogesh'); fd.append('city','bhopal');. Here, fd is the FormData object.
thank you mate,code worked first time,very clear and concise
thanks brother it was very usefull
Glad it helped
muchas gracias, buen video
De nada.
How to write the value of URL (in ajax script) if the files are not in the same folder? For example, if the jscript is in a different folder but is included in the index.php and the upload.php is also in a different folder, how to write the url value in the javascript/ajax code?
who can i send fd(file), and other values, input text value for example, i try this data: {fb, input value}, whitout results. nice video
Append the other values in FormData object like this -
var name = "Yogesh";
var city = "Bhopal";
fd.append('file',files[0]); // File
fd.append('name',name); // Name
fd.append('city',city); // City
In the PHP file read name and city using POST.
$name = $_POST['name'];
$city = $_POST['city'];
@@makitweb Thanks, u are my hero now, you have not idea how many days try to resolve this, i have only one more question, i try to send this radio buttom in the
var var_name = $('input[name=radio_name]=checked', '#form_id').val()
fd.append('var_name', var_name);
, but whitout results, i try like other var but nothing. again THNKS
Read the value of radio button like this -
var var_name = $('input[name="radio_name"]:checked').val();
fd.append('var_name', var_name);
I have already subscribed and Liked
You are amazing!
this was help me , thank you :)
You're welcome!
Thankyou. It would be good if you could do image upload with text to my sqltoo.
So simple ... neat and clean code ... can I ask you something ?
Is data also send to db
Hi Arslan,
No data is not send to database. You can view this tutorial -th-cam.com/video/4dU1yS6iwGI/w-d-xo.html
to know how to save image to database.
Very helpful video Mr. Yogesh Singh. What if I want to upload both image and video file
Hi Abimbola,
You have to add video file extensions in the $valid_extensions Array.
How can i send fd+string? (data: fd, id,)
Hi Carlos,
You need to append data to FormData object for sending value to AJAX file.
Example -
fd.append(name,'Yogesh');
fd.append('city','bhopal');.
Here, fd is the FormData object.
not working on android
Working good thanks
You're welcome.
Sakeeet
nice
братан хотя бы временами проверяй работает ли твой код