Posted by chrislive on 09/21/05 06:38
I am at work so I cant give you the code but what you need to do is the
following:
1. upload to a temporary directory (say /temp - this folder will need
to have appropriate access rights)
2. use the file_read funcions (look for tutorials on flat files for all
this)
3. import your data into the DB
4. If successful use unlink($file); to delete OR print error message
Thanks
Chris
Smitro wrote:
> Hi,
>
> I'm in the middle of writing a script to import a csv file into mySQL
> (as apart of a bigger project)
>
> I need to know what are the best steps to go from $_FILES to file().
>
> Once the file is read into an array I should be right. I don't want to
> keep a copy of the file uploaded either, as once it is imported I will
> have no use for it.
>
> I'm not sure, do I copy it store it then use it or is there a faster
> way? Will the temp file be deleted or do I have to delete it?
[Back to original message]
|