Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

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 added by Muhammad Haris , Software Engineer , InventorX
Date Posted: 2015/01/25
Asim Siddiqui
by 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
by 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
by 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

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.