PDA

View Full Version : PHP need help setting up a simple php uploader script



defjon66
March 29th, 2009, 12:22 PM
I am a beginner at this so pls someone help me figure out something. it may be nothing but here goes.

I am making a flash file uploader for my site and it needs a php script to actually upload the file to server. the code is as follows:

<body><?php
if ($_FILES['Filedata']['name']) {
move_uploaded_file($_FILES['Filedata']['tmp_name'], 'upload_directory/' . basename($_FILES['Filedata']['name']));
}
?>

will this work or do i need to change some vaues in the code such as the folder which the file goes into etc?

GregoryPankov
March 30th, 2009, 03:31 AM
Hello,

Take a look to EAFlashUpload flash file uploader (http://www.easyalgo.com/eaflashupload.aspx) .
It has example of receiving files on PHP:
http://www.easyalgo.com/examples/eaflashupload/simpleupload.html
At the bottom of page you will see a link to source code.

Hope this helps