A: 

I think you are misunderstanding something here. The PHP script is running on the server. It has no access to your local files.

The most common way to solve this is to do a file upload from your local machine through a HTML page. For that, see the PHP manual on file uploads.

Alternatively, if your machine and the server are in the same local network, you may be able to access your client PC's files through a network share. But we don't know enough about your setup to tell.

Pekka
Am trying to upload an image from my **local machine** (PC) to the FTP server
Sarfraz
@Sarfraz yes, but he's specifying a Windows path. The script is running on Linux. I doubt he has PHP running on his local machine.
Pekka
Hi Pekka, is there any simple sample code or example to show how to upload the file from window to the HTML and then from HTML to ftp server using PhP? I have looked around the PhP manual link you specified but it's too much complicated for the beginner like myself.
Ray
Hi Pekka, actually, my intention is to create the HTML form to allow user to select image file from their local machine (aka PC), click on the submit and the image file will be uploaded to the FTP server. Indeed, you are right that the code i mentioned above was running on Linux. Need your suggestion and opinions how to solve my problem. Much appreciated if you could guide me through this. Thanks
Ray
A: 

The error is pretty much self-explanatory, make sure that:

  • You are specifying the correct path
  • Directory dhimage has read permissions.
Sarfraz
Hi sarfraz, am uploading the image file from window directory instead. 'dhimage' is the folder in my window system. Any clue?
Ray