Need To Upload files with PHP and Ajax

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
itpvision
Forum Newbie
Posts: 5
Joined: Fri Jun 20, 2008 5:03 am

Need To Upload files with PHP and Ajax

Post by itpvision »

Hello,
I have a registration page, it is processed to a php script through ajax and javascript,
The script worked until a input type file is involved

var params = "username=" + encodeURI(document.getElementById("usernamee").value)+
"&password=" + encodeURI(document.getElementById("passwordd").value)+
"&name=" + encodeURI(document.getElementById("name").value)+
"&pic=" + pik +
;

As you may see,the value retrived from the input type file with id and name as pic, this will send a usual $_POST['pic'] , while I need to Process _$FILE['pic'];
How can I send the value of a file
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Need To Upload files with PHP and Ajax

Post by Christopher »

(#10850)
Post Reply