Upload text file (from local hard disk) to web

A

Anonymous

Guest
I want to upload a text file in my web based application.

The process is to read this file and add its contents to Database table on web.

When I try to give file name as c:\data\abcd.txt in INPUT text box and click on submit, it give error

Warning: fopen("c:/data/abcd.txt","r") - No such file or directory in /home2/prajaktasoftware/www/test/uploadtxt.php on line 31

I am using Win 98
and calling this program from Web

Please note that the file exists in local directory and has test data.

I tried it with apache (on local) it works fine.
Please help
 
PHP is a server side scripting language, so it'll work on your local machine (because it's run on the same machine as the file), but not the server because the file isn't there! You have to upload the file first. Please read the manual
 
Back
Top