ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل Muhammad Haris , Software Engineer , InventorX
تاريخ النشر: 2015/01/25
Asim Siddiqui
من قبل 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
من قبل 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
من قبل 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.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟