Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Upload text file (from local hard disk) to web

General discussions related to php

Moderators: macek, egami, gesf

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
vikaspa
New php-forum User
New php-forum User
 
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm

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
Jay
 

Thnaks

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

Your are always helping me in time and effectively
vikaspa
New php-forum User
New php-forum User
 
Posts: 21
Joined: Wed Jun 19, 2002 10:03 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.