In a custom module, I created an admin form but I need an input to upload a csv file. When the file is uploaded I need to parse in and then I add data to db.
I already made "add to db" and "parsing" functions because when I installed the module, a default file is parsing and added to the db.
Thanks.
EDIT :
I'm using Drupal 7...
The data is stocked in a custom table that is create when the admin user will install the module. There is no node or content type. I just need to save all data of the CSV file (5 columns) in the table by an admin user form. 1 time par month the admin user need to update the table with a new .CSV.
In frontend I have a form and when the user will submit it I check that the code is in the table.
My issue is that I didn't know how to upload the file into a Drupal directory and then access to it after the form submit.
As I said above I already created a parsing function and I tested with a CSV file directly in the module directory, it's working. Data is insert into the table that I have created.