uploading from client PC in MySQL thru ZSQL
Hello, I'm trying to "import" a CSV text file for feeding a MySQL database. I have : * DTML method including : <form method="post" action="import" enctype="multipart/form- data"> <input type="file" name="loadFileAnnu"> <input type="submit" value="Import File in MySQL"> </form> * ZSQL method 'import' parameter : loadFileAnnu query template : LOAD DATA LOCAL INFILE '<dtml-var loadFileAnnu>' INTO TABLE annuaire FIELDS TERMINATED BY ';' when i process the form, i always get the import/manage_testForm and if i try to upload the (local on my PC) file thru this, i get an MySQL error Error, _mysql.InterfaceError: (0, "File 'D:/AnnuaireTest.csv' not found (Errcode: 2)") SQL used: LOAD DATA LOCAL INFILE 'D:/Data/SIT67/AnnuaireTest.csv' INTO TABLE annuaire FIELDS TERMINATED BY ';' Am i doing something wrong or is it impossible to load/import in MySQL from the local file (so i should upload the file on the server then load into MySQL) ?? Thanks in advance for any tip or info. -- Didier Georgieff DDAF du Bas-Rhin - Cellule SIG 2, rue des Mineurs 67070 Strasbourg Cedex tél : 03.88.25.20.33 - fax : 03.88.25.20.01 email : didier.georgieff@agriculture.gouv.fr GéoWeb http://10.67.90.3 (Intranet Agriculture) GéoWeb http://sertit10.u-strasbg.fr (Internet)
+----[ Didier Georgieff ]--------------------------------------------- | | SQL used: | LOAD DATA LOCAL INFILE 'D:/Data/SIT67/AnnuaireTest.csv' | INTO TABLE annuaire FIELDS TERMINATED BY ';' Local means local to the actual mysql client (your webserver), not local to your user (browser). You could get your form to upload the file to a LocalFS directory and then use that path the INFILE. -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
participants (2)
-
Andrew Kenneth Milton -
Didier Georgieff