# My lambda function is unable to unzip a file

**URL:** <https://forum.serverless.com/t/my-lambda-function-is-unable-to-unzip-a-file/14478>\
**Category:** Serverless Framework\
**Created:** [March 24, 2021, 12:54am UTC](https://forum.serverless.com/t/my-lambda-function-is-unable-to-unzip-a-file/14478 "2021-03-24T00:54:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackmatrix](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jackmatrix/32/5376_2.png) [@jackmatrix](https://forum.serverless.com/u/jackmatrix)\
**Post date:** [March 24, 2021, 12:54am UTC](https://forum.serverless.com/t/my-lambda-function-is-unable-to-unzip-a-file/14478/1 "2021-03-24T00:54:12Z")

</div>

I deployed a flask app to lambda that includes a function that unzip a small file (124ko), but nothing works as expected. The unzipping clearly fail and I can’t find the reason.

```
2021-03-23T12:12:46.346+01:00	error [/tmp/39423ff39f7f4378a8f835a20fdcb688.zip]: missing 3183398882 bytes in zipfile

2021-03-23T12:12:46.346+01:00	(attempting to process anyway)

2021-03-23T12:12:46.346+01:00	error [/tmp/39423ff39f7f4378a8f835a20fdcb688.zip]: start of central directory not found;

2021-03-23T12:12:46.346+01:00	zipfile corrupt.

2021-03-23T12:12:46.346+01:00	(please check that you have transferred or created the zipfile in the

2021-03-23T12:12:46.346+01:00	appropriate BINARY mode and that you have compiled UnZip properly)

```

There is no problem when testing locally and the zip file is okay. So I guess the issue comes from lambda.

The code :

```
with open(file_path, "wb") as binary_file:
        binary_file.write(file_content)

```

**Expected behavior** : The file should unzip without problem just as it does when the app runs locally or in heroku.

P.S. : I am using postman for testing .

Any suggestion ?
