# How to attach files to a lambda function?

**URL:** <https://forum.serverless.com/t/how-to-attach-files-to-a-lambda-function/4158>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [April 4, 2018, 10:07am UTC](https://forum.serverless.com/t/how-to-attach-files-to-a-lambda-function/4158 "2018-04-04T10:07:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/pawel/32/1850_2.png) [@Pawel](https://forum.serverless.com/u/Pawel)\
**Post date:** [April 4, 2018, 10:07am UTC](https://forum.serverless.com/t/how-to-attach-files-to-a-lambda-function/4158/1 "2018-04-04T10:07:59Z")

</div>

Hi All,

I’m creating a function on Lambda in JavaScript (node.js) that is supposed to work with mp3 file downloaded from S3 bucket.  
JS function has as a dependency [lambda-audio](https://github.com/stojanovic/lambda-audio/) lib which is a JS wrapper on `lame` and `sox` (linux) binaries used to manipulate mp3 file.

While using serverless to deploy my function both files (`lame` and `sox`) are omitted and available during runtime, thus generating error. lambda-audio author is using Claudia.js to upload functions to Lamdba and says that it works with it.

I have used in my serverless.yml:

```auto
package:
  include:
    - node_modules/lambda-audio/bin/lame
    - node_modules/lambda-audio/bin/sox

```

to include those files but generated zip in .serverless directory doesn’t include those files.

I also use `severeless-webpack` plugin (which I plan to remove since Node 8.10 is supported now), which can interfere witch package building.

I’m not sure, so could anyone tell me whether those binary files (`lame` and `sox`) should be automatically included in a zip file uploaded to lambda or I should manually include them? If so, how to do it?

thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![Pawel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/pawel/32/1850_2.png) [@Pawel](https://forum.serverless.com/u/Pawel)\
**Post date:** [April 4, 2018, 12:03pm UTC](https://forum.serverless.com/t/how-to-attach-files-to-a-lambda-function/4158/2 "2018-04-04T12:03:22Z")

</div>

Ok, I did a test **without** `severeless-webpack plugin` and it creates a zip files with node\_modules inside. Those binary `lame` and `sox` files are present. So the plugin is the problem here.

Any idea how to fix that problem?

---

<div class="post-metadata">

**Author:** ![gabyquiles](https://avatars.discourse-cdn.com/v4/letter/g/d07c76/32.png) [@gabyquiles](https://forum.serverless.com/u/gabyquiles)\
**Post date:** [April 10, 2019, 5:36pm UTC](https://forum.serverless.com/t/how-to-attach-files-to-a-lambda-function/4158/3 "2019-04-10T17:36:59Z")

</div>

If you are using serverless-webpack you can use copy-webpack-plugin to include additional files in the package.
