# upload avi (video) failed

**URL:** <https://community.gatling.io/t/upload-avi-video-failed/782>\
**Category:** Gatling (Open-Source)\
**Created:** [January 20, 2014, 7:51pm UTC](https://community.gatling.io/t/upload-avi-video-failed/782 "2014-01-20T19:51:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shawna](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Shawna](https://community.gatling.io/u/Shawna)\
**Post date:** [January 20, 2014, 7:51pm UTC](https://community.gatling.io/t/upload-avi-video-failed/782/1 "2014-01-20T19:51:18Z")

</div>

I am using gatling version \<gatling.version\>2.0.0-M3a\</gatling.version\> in my testing which need to upload an avi file to the server.

This curl is working fine for me:

curl -i -u admin:hEbzRirYJQFKYk -F “file1=@sample.avi” -F “file2=@video.json;type=application/json” [https://servername/api/core/v3/contents](https://servername/api/core/v3/contents)

But when I tried the gatling script:

val headers\_1 = Map(  
“type” → “multipart/form-data”,  
“Authorization” → “Basic YmFuemFpQGRvcml0b3NvZnR3YXJlLmNvbTpndWVzc21l”)

val postBodyString = “”"{“content”: {“type”: “text/html”, “text”: “

Here comes the body for a video

”},  
“parent”: “[https://doritosoftware-banzai-8134-1-essential-plus.jivelandia.com/api/core/v3/places/1006](https://doritosoftware-banzai-8134-1-essential-plus.jivelandia.com/api/core/v3/places/1006)”,  
“subject”: “This is a test subject with video”,  
“type”: “video”}"""

.post("/api/core/v3/contents")  
.headers(headers\_1)  
.bodyPart(StringBodyPart(“json”, “${postBody}”, “utf-8”, contentType)) //, “UTF-8”, “1”))  
.bodyPart(RawFileBodyPart(“binary”, “sample.avi”, “video/x-msvideo”))  
.check(bodyString.saveAs(“bodyString”))  
.check(status.is(200)))

I always get 500 and checking the server log, it seems like the attachment (avi file is null). Can you give me some advices?

Thx

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [January 20, 2014, 7:57pm UTC](https://community.gatling.io/t/upload-avi-video-failed/782/2 "2014-01-20T19:57:34Z")

</div>

Hi,

There’s been several fixes in async-http-client regarding multipart since then.  
Could you upgrade to 1.7.24, please?  
[http://search.maven.org/#artifactdetails%7Ccom.ning%7Casync-http-client%7C1.7.24%7Cjar](http://search.maven.org/#artifactdetails%7Ccom.ning%7Casync-http-client%7C1.7.24%7Cjar)

One more thing: do you use HTTP or HTTPS?
