so i have this code
$('#sepia').click(function () {
var filePathName = tempFilePath;
alert(filePathName);
$.ajax({
type: 'POST',
url: 'php/sepia.php',
data: {
FilePath: filePathName
},
success: function (data) {
pictureReset();
}
});
});
alert(filePathName) has the correct value test.jpg but as soon as its passed with
data: {
FilePath: filePathName
}
the value is changes to incomprehensible text like this jhSerZR6i1T952C3bk7vEOGCj8Pz_tBYtuHcgrgj81A.
even if i replace filePathName with 'hp_2.jpg` i still get the same random letter message
never mind found the error. wasn't anywhere near that bit of code but when i came back to the script to use the file path name. added +"" at the end and fixed it :)
alertstatement is stringifying it, turning it into just a file name, but thePOSTis actually upload the image iself.console.log(filePathName)right before youralertand see what it gives you.Networktab and see what is actually being sent. If the stringtest.jpgis being sent, then the problem has to be on the server-side PHP code.