I am using SSIS to download files from google drive. In SSIS I am using for each loop with ADO enumerator with my files names stored in SQL server databases.
I am using the following code to download.
User::TargetFileConnection contains the target folder path with the download file name. e.g : d:\gdrive\property.xlxs
HTTP Connection Manager is pointing to my drive path.
FIle download is successful but when I try to open the file in excel it says
"File format or file extension is not valid. Verify that file has not been corrupted and that file format matches the file extension"
*Try Dim rawConnection As Object = Dts.Connections("HTTP Connection Manager").AcquireConnection(Nothing) Dim httpconnection As New HttpClientConnection(rawConnection) Dim targetfileconnection As String = Dts.Variables("User::TargetFileConnection").Value.ToString
httpconnection.DownloadFile(targetfileconnection, True) Dts.TaskResult = ScriptResults.Success Catch ex As Exception MessageBox.Show(ex.Message) Dts.TaskResult = ScriptResults.Failure End Try*
Please suggest a solution.
I tried following
disabling protected view setting in options->trust centre in excel.
Adding .gz extension during download.