Close

Extract ZIP file on FTP

The Azure FTP Connector currently has a limit on file size of 50MB. That’s pretty tiny for a file transfer application. It may even mean that you are unable to use this connector. There’s a solution however. In my situation I had a file of 134MB. I send this file in zipped format to the FTP server. The zipped file has a size of 6.4MB. After sending this file to the FTP server, I extract the file using a specific FTP connector action “Extract archive to folder”. After extracting the file, I can delete the zip file. Problem solved.

“Create_file”: {
“inputs”: {
“body”: “@body(‘Get_blob_content_using_path’)”,
“host”: {
“connection”: {
“name”: “@parameters(‘$connections’)[‘sftp_1’][‘connectionId’]”
}
},
“method”: “post”,
“path”: “/datasets/default/files”,
“queries”: {
“folderPath”: “/l198671/temp/from_azure/products/”,
“name”: “@body(‘Get_Blob_Metadata_using_path’)?[‘Name’]”,
“queryParametersSingleEncoded”: true
}
},
“runAfter”: {
“Get_blob_content_using_path”: [
“Succeeded”
] },
“type”: “ApiConnection”
},
“Extract_archive_to_folder”: {
“inputs”: {
“host”: {
“connection”: {
“name”: “@parameters(‘$connections’)[‘sftp_1’][‘connectionId’]”
}
},
“method”: “post”,
“path”: “/datasets/default/extractFolderV2”,
“queries”: {
“destination”: “/l198671/TEMP/from_azure/Products/”,
“overwrite”: true,
“queryParametersSingleEncoded”: true,
“source”: “@body(‘Create_file’)?[‘Path’]”
}
},
“runAfter”: {
“Create_file”: [
“Succeeded”
] },
“type”: “ApiConnection”
},
“Delete_file”: {
“inputs”: {
“host”: {
“connection”: {
“name”: “@parameters(‘$connections’)[‘sftp_1’][‘connectionId’]”
}
},
“method”: “delete”,
“path”: “/datasets/default/files/@{encodeURIComponent(encodeURIComponent(body(‘Create_file’)?[‘Path’]))}”
},
“runAfter”: {
“Extract_archive_to_folder”: [
“Succeeded”
] },
“type”: “ApiConnection”
}