can anyone tell me how to upload a file iis server I use the following code now but it doesn't work in iis server.

$fileName = basename( $_FILES['fileName']['name']);//filename from post

$currentdir=getcwd();//get current directory

$target_path = $currentdir."\\snaps\\" . $fileName ;

if(move_uploaded_file($_FILES['fileName']['tmp_name'], $target_path)) {
 echo "Success";

can I get a working code for this?

Thanks in advance,

Recommended Answers

All 2 Replies

Do you get any errors? Try to use the full path /your/server/path/to/your/application

Full codes will be appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.