# Haxe php make post request body from streams (from file)

**URL:** <https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994>\
**Category:** Haxe\
**Tags:** haxe-php\
**Created:** [August 25, 2018, 6:12am UTC](https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994 "2018-08-25T06:12:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rivetweb](https://community.haxe.org/user_avatar/community.haxe.org/rivetweb/32/1338_2.png) [@rivetweb](https://community.haxe.org/u/rivetweb)\
**Post date:** [August 25, 2018, 6:12am UTC](https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994/1 "2018-08-25T06:12:14Z")

</div>

i have memory limit in server  
and need to make big post request 50mb or more - it possible with haxe.Http reading data from file and write to http post?

---

<div class="post-metadata">

**Author:** ![rivetweb](https://community.haxe.org/user_avatar/community.haxe.org/rivetweb/32/1338_2.png) [@rivetweb](https://community.haxe.org/u/rivetweb)\
**Post date:** [August 29, 2018, 6:37pm UTC](https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994/2 "2018-08-29T18:37:05Z")

</div>

found this [haxe.Http - Haxe 4.2.1 API](https://api.haxe.org/haxe/Http.html#fileTransfer)

but marked as deprecated

how to upload file by haxe? any example?

---

<div class="post-metadata">

**Author:** ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)\
**Post date:** [August 29, 2018, 7:51pm UTC](https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994/3 "2018-08-29T19:51:40Z")

</div>

[haxe.Http - Haxe 4.2.1 API](https://api.haxe.org/haxe/Http.html#fileTransfer) isn’t marked as deprecated, only [haxe.Http - Haxe 4.2.1 API](https://api.haxe.org/haxe/Http.html#fileTransfert)

The difference in naming is subtle and can easily be missed 😉

---

<div class="post-metadata">

**Author:** ![rivetweb](https://community.haxe.org/user_avatar/community.haxe.org/rivetweb/32/1338_2.png) [@rivetweb](https://community.haxe.org/u/rivetweb)\
**Post date:** [August 31, 2018, 12:48pm UTC](https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994/4 "2018-08-31T12:48:32Z")

</div>

ok  
where i can find example for upload file?

---

<div class="post-metadata">

**Author:** ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)\
**Post date:** [August 31, 2018, 1:48pm UTC](https://community.haxe.org/t/haxe-php-make-post-request-body-from-streams-from-file/994/5 "2018-08-31T13:48:19Z")

</div>

Don’t know of examples, but considering the arguments it should be something like this:

```haxe
var http = new haxe.Http("url");
var file = "myfile.txt";
var input = sys.io.File.read(file);
http.fileTransfer("thePostVarName", file, input, sys.FileSystem.stat(file).size);
http.request(true);
input.close();

```
