Preventing access to and download of Excel spreadsheet for PHP


I am going to use an Excel Spreadsheet to populate a MySQL table.

So simply, the Excel Spreadsheet can be edited and uploaded to the website and the content online will be displayed using PHP coding.

My problem is I do not want competitors downloading and using my Excel Spreadsheet. How can I prevent access to this Excel Spreadsheet? How can I stop all search engines from ranking it?

I was thinking of storing the Excel Spreadsheet on a website that does not rank well. But people could still download it?

Thanks for any help on this.


why are you uploading the spreadsheet and leaving it on the server?

Just upload the data into the mysql table and have it delete the spreadsheet when it’s complete.

Or even simpler buy navicat for about £50 and just use their import wizard which can take numerous file types and upload it into a mysql table.

…if you did need to store it online use .htaccess to password protect the folder.

I was thinking for ease of use - simply upload to web server.

How would I upload to mysql table directly? And delete the excel spread sheet afterwards?

I will look at navicat…


Its a personal preference and some people wouldn’t like it but i do think Navicat is a really useful program. If you haven’t used it before it’s pretty simple to get the hang of. You can see the data in your live mysql tables and even edit it directly almost like excel. If you want to do a bulk upload then there is a wizard that guides you through uploading.
The other advantage is you can easily duplicate tables and rename before an upload so you have a copy/backup at a specific point in time. You do need a server though that you can have remote access to your database from a fixed ip address (or you’d have to change it each time if your ip changes).

PHPmyadmin is another easy-ish ‘program’ that will allow you to edit/change/add/upload/download stuff to your mysql database. It’s web based so you can just install it on your website
It’s slightly more tricky than navicat in my opinion but is a useful tool. oh and is free :slight_smile:
I think it might need a CSV though but you can do that in excel anyway.

Something to bear in mind is that excel allows lots of odd characters that won’t output correctly to a UTF8 page. We have had lots of trouble trying to sort this problem and will be moving away from using excel

With Navicat can you upload Excel Spreadsheets to MySQL tables?

you don’t upload the excel spreadsheet as such you upload the data from within the excel spreadsheet into a mysql table.

The excel spreadsheet is never actually saved on your webserver as a file someone could access.

If you have exactly the same field name as your excel spreadsheet then navicat will automatically match up the fields so it uploads into the correct mysql fields.

Sounds like the right solution.

Will it replace the current table too? I would need it to delete the current data and replace it with the new file. Or at least recognise the new data and add it without adding duplicate content.

Is this possible?

it will do either at the end of the wizard you get the choice to either overwrite everything or ‘add’ to the existing.

As above i tend to copy the table before hand and give it a date so i know when i last updated and can rollback very quickly if something goes wrong.

Do you have a fixed IP address on your computer? and can your website allow remote access to the mysql database from that IP as you will need that for navicat as it runs on a local computer.

I am not sure about the fixed IP.
I am also not sure about remote access to MYSQL database

I have a Mac computer and am hosting with GoDaddy. Will this set up work?

Navicat has a version for mac so that is ok. You can download a trial version to give it a go before you buy.

Godaddy i know has remote access as i have a hosting package with them too. You need to go into the mysql bit on the control panel and add a remote ip address. The only problem you will have is that your IP will change if you are on a home broadband package. So you would need to find your ip address (loads of websites will tell you this) and each time it changes update godaddy to let you in. Depends how often you need to do this as it could be annoying over time.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.