|
Posted by Hilarion on 09/13/05 15:25
> Yes u r right the "opendir" function returns FALSE. Now I am on the
> right track, Thanks.
> The scenario is like this I want to upload a file on FTP site in a
> perticular directory, for this I am giving browse button at client
> script, when the user submits then I want this selected file is to be
> uploaded on FTP server. Now please guide me.
As far as I know you can't do it this way (allow user to select
file and upload it via FTP).
PHP is working on the webserver, so it is unable to list files available
on user machine and it's unable to get the file from the user machine.
You can create HTML form and place <input type="file" ... /> field
in it to allow user to select and upload (via HTTP protocol) the file
to the webserver (it has to be configured to allow HTTP file upload)
by submiting the form. The script which gets the form submission results
has to move the file to target location (maybe via FTP to some other
server or simply move it to other webserver folder). You will have
no control over user actions, so the user can select file from any
folder on his/her computer.
There's also something wrong with the webserver configuration if
"opendir" returns FALSE and you get no warning message even with
error_reporting set to E_ALL.
Hilarion
Navigation:
[Reply to this message]
|