I have a website where I want to prompt the user to select multiple files to be read which the code will then upload data into my MySQL database.
Is it possible to prompt them for multiple files or do I have to do them individually?
Currently the files are dbf files and I was going to use dbase_open function, but I don't think my hosting company (GoDaddy) allows that function. When I did the phpinfo page I don't see 'enable-dbase'. Can I only read like csv files from my local machine? Or do I need to load them to my hosting server first and then process them?
One of the files is over 50MB and concerned about how long to process. Has anyone had any problems loading this much data at one time from a file?
What is the best functions to use to read and insert the data?
Thanks for any help or links to scripts you can provide.
M
Reading local files
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Reading local files
Yes, it is a browser function -- see docs for input type=file.marnieg wrote:Is it possible to prompt them for multiple files or do I have to do them individually?
You need to call your hosting company.marnieg wrote:Currently the files are dbf files and I was going to use dbase_open function, but I don't think my hosting company (GoDaddy) allows that function. When I did the phpinfo page I don't see 'enable-dbase'. Can I only read like csv files from my local machine? Or do I need to load them to my hosting server first and then process them?
fopen() and fread() are the most basic. There are also functions like file_get_contents(), etc. See the PHP docs for Filesystem functions.marnieg wrote:What is the best functions to use to read and insert the data?
(#10850)