Upload text file (from local hard disk) to web

General discussions related to php

Moderators: macek, egami, gesf

vikaspa
New php-forum User
New php-forum User
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

Upload text file (from local hard disk) to web

Postby vikaspa » Mon Sep 16, 2002 6:37 pm

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

Jay

Postby Jay » Mon Sep 16, 2002 11:50 pm

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

vikaspa
New php-forum User
New php-forum User
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

Thnaks

Postby vikaspa » Tue Sep 17, 2002 2:23 am

Your are always helping me in time and effectively


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 2 guests