Fix Downloaded Excel File


I created a php web app in Azure that pulls an excel file (xlsx) from an external website. I would like to parse it and insert the data into SQL server, but the file can't be read.


If I open it on my own OS in excel, it looks fine. I can save that file and then PHP or Javascript can parse it just fine.


The file size jumps up a lot from the first file to the saved second file.


I can't figure out why the first file is corrupt.


I need to take out this manual step and find an automated solution to fix the xlsx file using my Azure web app so I can schedule the job.


I did find a way to do it via a vbs file on another web server that I have access to the OS. It runs a CreateObject("Excel.Application") command that basically just opens and saves the file. Not sure that's possible on Azure.


Does anybody have any ideas?

0 Replies