views:

37

answers:

2

hi i just want to know that if i am using move_uploaded_file function and use two argument first as the name of file and second as the destination. Normally i have uploaded many files with class uploader but now i want to give the destination as http://www.mydomain.com/testing/ Although i have given 777 permision to this folder but when i try to execute the upload code error came Destination directory can't be created. Can't carry on a process. please tell me how can i upload the file local to server using php code

+1  A: 

If you are passing http://www.mydomain.com/testing/ as the target, this is wrong.

You can't just upload files to servers via HTTP, you only can do that to local folders, can you paste the exact code so we can know better what are you trying to do?

aularon
A: 

move_uploaded_file is a server-side function, so all the paths should be specified server side. If your upload.php (i'm assuming the filename) is in the main directory of the website www.mydomain.com/ which is probably /home/youruser/public_html/ then you can specify the destination as simply "testing/" If your upload file is in some nested directory, then it may work better to specify the full destination path: /home/youruser/public_html/testing

good luck

Mikhail

related questions