Firefox and FormData Objects — Gotcha/Issue

When sending over a file using FormData objects and XMLHttpRequest via POST, make sure not to name the file object with the string “file” as in

formData.append(“file”, e.target.files[0]);

Use any other name than “file”, e.g.:

formData.append(“userfile”, e.target.files[0]);

Not sure what happens under the hood, but for some reason with a PHP based server (perhaps the problem was with the framework being used), the POST never occurred until I changed the key string naming.

Share

PHP function and method names are case-insensitive

Wow! You learn something new everyday. Today, I learned that PHP function and method names are case-insensitive! This after a couple of years of using PHP off and on…

Share