Uploading Excel File data into SQL database via a website

wisheschoice

New Member
Joined
Jan 25, 2017
Messages
1
[FONT=&quot]I am using php to develop my website and I need to be able to browse for and upload an Excel sheet. I then need to store the information in an SQL database.
I realise this is an relatively open question but I am have looked for information on how to do this and have not got very far. Storing the data in the SQL database is fine but I am not sure how to upload the spreadsheet such that it can be read by the website.
If anyone can point me in the right direction I would be grateful.
[/FONT]
[FONT=&quot]Here my web page is: awesome birthday wishes
[/FONT]
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
It's been a number of years since I did something similar. If I recall correctly for my particular implementation it was sufficient to add code to my Excel book that allowed the submission of form data automatically (albeit to a MySQL database). It was far from optimal and not the approach I'd take now.

There were and are several PHP libraries available for reading from Excel files. You might want to investigate here https://phpexcel.codeplex.com/
 
Upvote 0
I am using php to develop my website and I need to be able to browse for and upload an Excel sheet. I then need to store the information in an SQL database.
I realise this is an relatively open question but I am have looked for information on how to do this and have not got very far. Storing the data in the SQL database is fine but I am not sure how to upload the spreadsheet such that it can be read by the website.
If anyone can point me in the right direction I would be grateful.
Here my web page is: awesome birthday wishes
To upload a file you first need a HTML form with enctype="multipart/form-data", something like this:
HTML:
< form enctype="multipart/form-data" action="upload_file.php" method="POST" >
Select a file to upload: 
< input type="submit" name="submit" value="Upload File" / >
< /form >
For the VBA side, you construct the form data string containing the file contents, and send it in a "POST" request using either IE, XMLhttp or WinHttpRequest to the web page containing the form to upload the file. See Post binary data to URL from WSH/ASP/VBA/VBScript. And there is a routine for constructing the form data (binary because it is an Excel file) at Automatic file upload using IE+ADO without user interaction - VBSscript.
 
Upvote 0

Forum statistics

Threads
1,216,303
Messages
6,129,983
Members
449,548
Latest member
lharr28

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top