Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How can we upload a txt or csv file from local pc to MySql server without using drag and drop or form submit?

user should not upload the file, JavaScript or any other technology shall automatically get the file from the specified path.

user-image
Question ajoutée par Muhammad Haris , Software Engineer , InventorX
Date de publication: 2015/01/25
Asim Siddiqui
par Asim Siddiqui , Analyst Programmer , United Bank Ltd.

You can schedule the task to periodically check if the file has arrived in a particular folder, then run a PHP method that would read the file and then insert it into the MySQL database.

 

The scheduling can be done using crontab

 

This should be a good starting point to read on how to go about it.

 

http://code.tutsplus.com/tutorials/managing-cron-jobs-with-php--net-19428

Eyad Makki
par Eyad Makki , IT SENIOR MANAGER , Strategic Partnerships

If you do not want to use a web interface to do so, try using a MySQL client on your PC. Some of them have import features where you can import CSV files. You can set separator (comma or semicolon) and headers. Other way is to use the online MySQL manager from your hosting provider like PHP MyAdmin

Muhammad Majid Saleem
par Muhammad Majid Saleem , Senior PHP Developer / Project Manager , SwaamTech

I don't think so, that could be happens using PHP. You have to submit a form to upload a file from local to server.

More Questions Like This